Created
March 13, 2009 05:24
-
-
Save davidlee/78445 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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