aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-03-29 04:27:23 -0700
committerGodfrey Chan <godfreykfc@gmail.com>2014-03-29 04:34:20 -0700
commit945dd254ae4a79705c2c05a683fc37a8c98c8aeb (patch)
treecd99f279cdd67180122db5ba20851cb4e2b9ba7f /activerecord/lib/active_record/reflection.rb
parent86c53d510cf31b792a7e96a44535e64b3983d17a (diff)
downloadrails-945dd254ae4a79705c2c05a683fc37a8c98c8aeb.tar.gz
rails-945dd254ae4a79705c2c05a683fc37a8c98c8aeb.tar.bz2
rails-945dd254ae4a79705c2c05a683fc37a8c98c8aeb.zip
Ensure we are returning either `true` or `false` for `#==`
460eb83d cused `ActiveRecord::Base#==` to sometimes return `nil` in some cases, this ensures we always return a boolean value. Also fixed a similar problem in AR reflections.
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r--activerecord/lib/active_record/reflection.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index bce7766501..03b5bdc46c 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -151,7 +151,7 @@ module ActiveRecord
super ||
other_aggregation.kind_of?(self.class) &&
name == other_aggregation.name &&
- other_aggregation.options &&
+ !other_aggregation.options.nil? &&
active_record == other_aggregation.active_record
end