aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-07-16 11:37:53 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-07-16 11:37:53 -0700
commitdbdaf75777d4cc16842160747ae8e0002fe271c3 (patch)
tree9c7cdb8eb23cd7d5da1316e31c8bb20b4d678462 /activerecord
parent5b83f46a1907f258cae044f8d2e83a7fae15b7b5 (diff)
downloadrails-dbdaf75777d4cc16842160747ae8e0002fe271c3.tar.gz
rails-dbdaf75777d4cc16842160747ae8e0002fe271c3.tar.bz2
rails-dbdaf75777d4cc16842160747ae8e0002fe271c3.zip
just push on to the scope chain items. Oops! (thanks @carlosantoniodasilva)
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/join_dependency/join_association.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/join_dependency/join_association.rb
index 97956ea3a1..06b70c050e 100644
--- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb
+++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb
@@ -106,10 +106,9 @@ module ActiveRecord
end
if reflection.type
- scope_chain_items.concat [
+ scope_chain_items <<
ActiveRecord::Relation.new(reflection.klass, table)
.where(reflection.type => foreign_klass.base_class.name)
- ]
end
scope_chain_items.concat [reflection.klass.send(:build_default_scope)].compact