aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-02-14 14:23:04 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-02-14 14:23:04 -0800
commit213b2fbf40f6a1ce8381749bd5ba734f20bd4b21 (patch)
treebc432094b82a6695919922a6067c455ef1476f8e /activerecord/test/cases/associations
parent8e6ef92fd9ede38aa435afeaef6370ff65191a0b (diff)
downloadrails-213b2fbf40f6a1ce8381749bd5ba734f20bd4b21.tar.gz
rails-213b2fbf40f6a1ce8381749bd5ba734f20bd4b21.tar.bz2
rails-213b2fbf40f6a1ce8381749bd5ba734f20bd4b21.zip
make a singleton for AssociationScope
AssociationScope no longer maintains state, so we're safe to keep a singleton and save on GC time
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--activerecord/test/cases/associations/association_scope_test.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/test/cases/associations/association_scope_test.rb b/activerecord/test/cases/associations/association_scope_test.rb
index f9793277e5..c78b036f53 100644
--- a/activerecord/test/cases/associations/association_scope_test.rb
+++ b/activerecord/test/cases/associations/association_scope_test.rb
@@ -6,8 +6,7 @@ module ActiveRecord
module Associations
class AssociationScopeTest < ActiveRecord::TestCase
test 'does not duplicate conditions' do
- association_scope = AssociationScope.new
- scope = association_scope.scope(Author.new.association(:welcome_posts),
+ scope = AssociationScope.scope(Author.new.association(:welcome_posts),
Author.connection)
wheres = scope.where_values.map(&:right)
assert_equal wheres.uniq, wheres