diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-28 18:07:08 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-28 18:27:41 +0000 |
commit | dae7b6545372cba40e08554b9a7b2f391eaa5c6e (patch) | |
tree | 6035c63c71dc0243560412b08110bd7e496f8552 /activerecord/lib/active_record/attribute_methods.rb | |
parent | 93c1f11c0a5097a5431819a1551a02a869a16a38 (diff) | |
download | rails-dae7b6545372cba40e08554b9a7b2f391eaa5c6e.tar.gz rails-dae7b6545372cba40e08554b9a7b2f391eaa5c6e.tar.bz2 rails-dae7b6545372cba40e08554b9a7b2f391eaa5c6e.zip |
Support establishing connection on ActiveRecord::Model.
This is the 'top level' connection, inherited by any models that include
ActiveRecord::Model or inherit from ActiveRecord::Base.
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index 44b0956e4e..c5834e2fef 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -61,7 +61,7 @@ module ActiveRecord raise DangerousAttributeError, "#{method_name} is defined by ActiveRecord" end - if active_record_super == Base + if [Base, Model].include?(active_record_super) super else # If B < A and A defines its own attribute method, then we don't want to overwrite that. |