diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-06-06 08:49:38 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-06-06 08:49:38 -0700 |
commit | b4fb80cbdab118125df0d48e74b6818fe5ec65d5 (patch) | |
tree | b912b5041ee4a6a1ea7fdb3a743a7205b6bbd579 /activerecord/test | |
parent | 96123978ff5cbfe1ce56c2a3203b02007823335b (diff) | |
parent | ef9bbb87e8228940f768580a7d05d5feadec0d1e (diff) | |
download | rails-b4fb80cbdab118125df0d48e74b6818fe5ec65d5.tar.gz rails-b4fb80cbdab118125df0d48e74b6818fe5ec65d5.tar.bz2 rails-b4fb80cbdab118125df0d48e74b6818fe5ec65d5.zip |
Merge pull request #6645 from amatsuda/reduce_string_instance
Reduce number of String instance
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/finder_respond_to_test.rb | 3 | ||||
-rw-r--r-- | activerecord/test/cases/finder_test.rb | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/test/cases/finder_respond_to_test.rb b/activerecord/test/cases/finder_respond_to_test.rb index 810c1500cc..eedbaac3bd 100644 --- a/activerecord/test/cases/finder_respond_to_test.rb +++ b/activerecord/test/cases/finder_respond_to_test.rb @@ -80,7 +80,6 @@ class FinderRespondToTest < ActiveRecord::TestCase private def ensure_topic_method_is_not_cached(method_id) - class << Topic; self; end.send(:remove_method, method_id) if Topic.public_methods.any? { |m| m.to_s == method_id.to_s } + class << Topic; self; end.send(:remove_method, method_id) if Topic.public_methods.include? method_id end - end diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index f7ecab28ce..8c16972c12 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -629,7 +629,7 @@ class FinderTest < ActiveRecord::TestCase def test_dynamic_finder_on_one_attribute_with_conditions_returns_same_results_after_caching # ensure this test can run independently of order - class << Account; self; end.send(:remove_method, :find_by_credit_limit) if Account.public_methods.any? { |m| m.to_s == 'find_by_credit_limit' } + class << Account; self; end.send(:remove_method, :find_by_credit_limit) if Account.public_methods.include?(:find_by_credit_limit) a = Account.where('firm_id = ?', 6).find_by_credit_limit(50) assert_equal a, Account.where('firm_id = ?', 6).find_by_credit_limit(50) # find_by_credit_limit has been cached end |