diff options
author | Jon Leighton <j@jonathanleighton.com> | 2010-09-30 23:29:23 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2010-09-30 23:29:23 +0100 |
commit | 704961ce688f5bc1942529f44ea6b00014ef8378 (patch) | |
tree | b951112aed4914cdc4203bca6e810a7b71d37e82 /activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb | |
parent | b689834bcf2730353d066277f43047f10abb8d30 (diff) | |
parent | 91deff08c940f16ed149e7628694faff0393fe0a (diff) | |
download | rails-704961ce688f5bc1942529f44ea6b00014ef8378.tar.gz rails-704961ce688f5bc1942529f44ea6b00014ef8378.tar.bz2 rails-704961ce688f5bc1942529f44ea6b00014ef8378.zip |
Merge branch 'master' into nested_has_many_through_2
Diffstat (limited to 'activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb b/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb index 38454ec242..e429806b0c 100644 --- a/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +++ b/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb @@ -39,7 +39,7 @@ module ActiveRecord def set_inverse_instance(record, instance) return if record.nil? || !we_can_set_the_inverse_on_this?(record) inverse_relationship = @reflection.polymorphic_inverse_of(record.class) - unless inverse_relationship.nil? + if inverse_relationship record.send(:"set_#{inverse_relationship.name}_target", instance) end end |