diff options
author | Jon Leighton <j@jonathanleighton.com> | 2010-10-15 17:46:09 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2010-10-15 17:46:09 +0100 |
commit | edc176d33be9499f4c096779c5b4711b5daf0c06 (patch) | |
tree | c775c7643fca33a3ff18aaa724064e2a167c8616 /activerecord/lib/active_record/associations/has_one_through_association.rb | |
parent | d619e399380cd840f9f5ec88bb3d823fbb1f4d08 (diff) | |
download | rails-edc176d33be9499f4c096779c5b4711b5daf0c06.tar.gz rails-edc176d33be9499f4c096779c5b4711b5daf0c06.tar.bz2 rails-edc176d33be9499f4c096779c5b4711b5daf0c06.zip |
Make sure nested through associations are read only
Diffstat (limited to 'activerecord/lib/active_record/associations/has_one_through_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_through_association.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_through_association.rb b/activerecord/lib/active_record/associations/has_one_through_association.rb index fba0a2bfcc..8153eb7c57 100644 --- a/activerecord/lib/active_record/associations/has_one_through_association.rb +++ b/activerecord/lib/active_record/associations/has_one_through_association.rb @@ -14,6 +14,8 @@ module ActiveRecord private def create_through_record(new_value) #nodoc: + ensure_not_nested + klass = @reflection.through_reflection.klass current_object = @owner.send(@reflection.through_reflection.name) |