1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

no need of nil check

This commit is contained in:
Neeraj Singh 2010-09-29 14:17:59 -04:00 committed by Aaron Patterson
parent a40e3c1a96
commit 299e9f6927

View file

@ -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