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:
parent
a40e3c1a96
commit
299e9f6927
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ module ActiveRecord
|
||||||
def set_inverse_instance(record, instance)
|
def set_inverse_instance(record, instance)
|
||||||
return if record.nil? || !we_can_set_the_inverse_on_this?(record)
|
return if record.nil? || !we_can_set_the_inverse_on_this?(record)
|
||||||
inverse_relationship = @reflection.polymorphic_inverse_of(record.class)
|
inverse_relationship = @reflection.polymorphic_inverse_of(record.class)
|
||||||
unless inverse_relationship.nil?
|
if inverse_relationship
|
||||||
record.send(:"set_#{inverse_relationship.name}_target", instance)
|
record.send(:"set_#{inverse_relationship.name}_target", instance)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue