diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-06-16 16:59:12 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-06-16 16:59:12 -0300 |
commit | 16ac353f4cb9510aad88240a1c566345da8ceeed (patch) | |
tree | 1d3eb279cabea3d6b315ddc47d471f6fb08a029b /activerecord/lib/active_record/base.rb | |
parent | 34a068d053c7268caad78d4f1f90ab0e2a38682f (diff) | |
parent | 01a4bc84b8787df74d54147a0cf564df75e87970 (diff) | |
download | rails-16ac353f4cb9510aad88240a1c566345da8ceeed.tar.gz rails-16ac353f4cb9510aad88240a1c566345da8ceeed.tar.bz2 rails-16ac353f4cb9510aad88240a1c566345da8ceeed.zip |
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 4e7979cfff..3f2b56d0c4 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -11,6 +11,7 @@ require 'active_support/core_ext/hash/indifferent_access' require 'active_support/core_ext/hash/slice' require 'active_support/core_ext/string/behavior' require 'active_support/core_ext/symbol' +require 'active_support/core_ext/object/metaclass' module ActiveRecord #:nodoc: # Generic Active Record exception class. @@ -2128,7 +2129,7 @@ module ActiveRecord #:nodoc: # end # end def define_attr_method(name, value=nil, &block) - sing = class << self; self; end + sing = metaclass sing.send :alias_method, "original_#{name}", name if block_given? sing.send :define_method, name, &block |