Skip to content

Instantly share code, notes, and snippets.

@davidlee
Created March 13, 2009 05:24
Show Gist options
  • Save davidlee/78445 to your computer and use it in GitHub Desktop.
Save davidlee/78445 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'active_support'
require 'active_record'
# punch the duck
# Module initialisation and plug-in code inspired by will_paginate...
module MoneyHandler
module Validations
module ClassMethods
end
end
class << self
def enable
::ActiveRecord::Validations::ClassMethods.send :include, MoneyHandler::Validations::ClassMethods
# ActiveRecord.extend MoneyHandler::Normalisations
end
end
end
if defined?(ActiveRecord) && defined?(ActiveRecord::Validations)
MoneyHandler.enable
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment