Permalink
Browse files

no need of nil check

  • Loading branch information...
Neeraj Singh authored and tenderlove committed Sep 29, 2010
1 parent a40e3c1 commit 299e9f692798f502bd74d16655b611bccf520620
@@ -39,7 +39,7 @@ def we_can_set_the_inverse_on_this?(record)
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

0 comments on commit 299e9f6

Please sign in to comment.