Skip to content

Instantly share code, notes, and snippets.

@davidlee
Created March 13, 2009 06:10
Show Gist options
  • Save davidlee/78452 to your computer and use it in GitHub Desktop.
Save davidlee/78452 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'activerecord'
module Foo
def foo
puts "foo"
end
end
ActiveRecord::Validations::ClassMethods.send(:include, Foo)
ActiveRecord::Validations.extend( ActiveRecord::Validations::ClassMethods)
class TestClass < ActiveRecord::Base
end
ActiveRecord::Base.send(:include,ActiveRecord::Validations)
TestClass.foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment