Browse files

fix caching of automatic inverse of. 💣

  • Loading branch information...
1 parent 634fd04 commit 27be568639ec14c9696f79d554301fa69cb8edae @tenderlove tenderlove committed Jun 13, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/reflection.rb
View
4 activerecord/lib/active_record/reflection.rb
@@ -397,7 +397,7 @@ def inverse_name
if @automatic_inverse_of == false
nil
else
- @automatic_inverse_of = automatic_inverse_of
+ @automatic_inverse_of ||= automatic_inverse_of
end
end
end
@@ -419,6 +419,8 @@ def automatic_inverse_of
inverse_name
end
end
+
+ false

This change puts the method's implementation out of sync with its documentation. false is not nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
end
# Checks if the inverse reflection that is returned from the

0 comments on commit 27be568

Please sign in to comment.