diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-09-29 14:17:59 -0400 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-29 16:43:00 -0700 |
commit | 299e9f692798f502bd74d16655b611bccf520620 (patch) | |
tree | d301a677f37f1251eeabca3c5a123557b080a0f2 /activerecord | |
parent | a40e3c1a9604ab3737ad2465c8f6a6db0fe0cc78 (diff) | |
download | rails-299e9f692798f502bd74d16655b611bccf520620.tar.gz rails-299e9f692798f502bd74d16655b611bccf520620.tar.bz2 rails-299e9f692798f502bd74d16655b611bccf520620.zip |
no need of nil check
Diffstat (limited to 'activerecord')
-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 |