aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/spawn_methods.rb
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/relation/spawn_methods.rb
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/relation/spawn_methods.rb')
-rw-r--r--activerecord/lib/active_record/relation/spawn_methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb
index c63ae9c9fb..2552cbd234 100644
--- a/activerecord/lib/active_record/relation/spawn_methods.rb
+++ b/activerecord/lib/active_record/relation/spawn_methods.rb
@@ -64,7 +64,7 @@ module ActiveRecord
private
def relation_with(values) # :nodoc:
- result = Relation.new(klass, table, values)
+ result = Relation.create(klass, table, values)
result.extend(*extending_values) if extending_values.any?
result
end