From a57b7842d0fcdcbcc567532d3a5c1f2628057a0d Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 27 Apr 2012 10:30:52 +0100 Subject: remove unnecessary test code --- activerecord/test/cases/named_scope_test.rb | 4 ---- activerecord/test/models/topic.rb | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) (limited to 'activerecord') diff --git a/activerecord/test/cases/named_scope_test.rb b/activerecord/test/cases/named_scope_test.rb index cc64afaa71..aa36a02982 100644 --- a/activerecord/test/cases/named_scope_test.rb +++ b/activerecord/test/cases/named_scope_test.rb @@ -70,10 +70,6 @@ class NamedScopeTest < ActiveRecord::TestCase assert_equal Topic.replied.approved, Topic.replied.approved_as_string end - def test_scopes_can_be_specified_with_deep_hash_conditions - assert_equal Topic.replied.approved, Topic.replied.approved_as_hash_condition - end - def test_scopes_are_composable assert_equal((approved = Topic.find(:all, :conditions => {:approved => true})), Topic.approved) assert_equal((replied = Topic.find(:all, :conditions => 'replies_count > 0')), Topic.replied) diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb index ef9de9669c..079e403444 100644 --- a/activerecord/test/models/topic.rb +++ b/activerecord/test/models/topic.rb @@ -11,11 +11,7 @@ class Topic < ActiveRecord::Base scope :scope_with_lambda, lambda { scoped } scope :by_lifo, -> { where(:author_name => 'lifo') } - - ActiveSupport::Deprecation.silence do - scope :approved_as_hash_condition, :conditions => {:topics => {:approved => true}} - scope :replied, :conditions => ['replies_count > 0'] - end + scope :replied, -> { where 'replies_count > 0' } scope 'approved_as_string', -> { where(:approved => true) } scope :anonymous_extension, -> { scoped } do -- cgit v1.2.3