aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/join_dependency
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-07-23 14:43:17 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-07-23 14:43:32 -0700
commitf38b5444428f418c4e6377bbb40d7518ea0c61a7 (patch)
tree21da7b1c7752c31f17fefb1ef6635e221ed8ec78 /activerecord/lib/active_record/associations/join_dependency
parentb017562382e1c43655eec3456d2a78c1d4407952 (diff)
downloadrails-f38b5444428f418c4e6377bbb40d7518ea0c61a7.tar.gz
rails-f38b5444428f418c4e6377bbb40d7518ea0c61a7.tar.bz2
rails-f38b5444428f418c4e6377bbb40d7518ea0c61a7.zip
add a specific factory method rather than using new
Diffstat (limited to 'activerecord/lib/active_record/associations/join_dependency')
-rw-r--r--activerecord/lib/active_record/associations/join_dependency/join_association.rb4
1 files changed, 2 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 8c528af399..58fc00d811 100644
--- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb
+++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb
@@ -105,13 +105,13 @@ module ActiveRecord
if item.is_a?(Relation)
item
else
- ActiveRecord::Relation.new(klass, table).instance_exec(self, &item)
+ ActiveRecord::Relation.create(klass, table).instance_exec(self, &item)
end
end
if reflection.type
scope_chain_items <<
- ActiveRecord::Relation.new(klass, table)
+ ActiveRecord::Relation.create(klass, table)
.where(reflection.type => foreign_klass.base_class.name)
end