diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-23 14:43:17 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-23 14:43:32 -0700 |
commit | f38b5444428f418c4e6377bbb40d7518ea0c61a7 (patch) | |
tree | 21da7b1c7752c31f17fefb1ef6635e221ed8ec78 /activerecord/lib/active_record/relation/delegation.rb | |
parent | b017562382e1c43655eec3456d2a78c1d4407952 (diff) | |
download | rails-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/delegation.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/delegation.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb index 8d6740246c..7ed65a548c 100644 --- a/activerecord/lib/active_record/relation/delegation.rb +++ b/activerecord/lib/active_record/relation/delegation.rb @@ -73,10 +73,8 @@ module ActiveRecord module ClassMethods # :nodoc: @@subclasses = ThreadSafe::Cache.new(:initial_capacity => 2) - def new(klass, *args) - relation = relation_class_for(klass).allocate - relation.__send__(:initialize, klass, *args) - relation + def create(klass, *args) + relation_class_for(klass).new(klass, *args) end # This doesn't have to be thread-safe. relation_class_for guarantees that this will only be |