diff options
author | Michael Koziarski <michael@koziarski.com> | 2010-12-02 15:36:05 +1300 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-02 08:40:34 -0800 |
commit | 96eec090dfd50326146b2f690408fefec50c5111 (patch) | |
tree | 55bef0491b1bca2679bd6e3defe8174b637b4b99 /activerecord/lib | |
parent | 0afebd5b31bdc6edc1399c77153e65f5ea156fe1 (diff) | |
download | rails-96eec090dfd50326146b2f690408fefec50c5111.tar.gz rails-96eec090dfd50326146b2f690408fefec50c5111.tar.bz2 rails-96eec090dfd50326146b2f690408fefec50c5111.zip |
Work around a strange piece of Syck behaviour where it checks Model#respond_to? before initializing the object.
Things like YAML.load(YAML.dump(@post)) won't work without this.
Diffstat (limited to 'activerecord/lib')
-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 67f70c434e..4f4a0a5fee 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -54,7 +54,7 @@ module ActiveRecord protected def attribute_method?(attr_name) - attr_name == 'id' || @attributes.include?(attr_name) + attr_name == 'id' || (defined?(@attributes) && @attributes.include?(attr_name)) end end end |