diff options
author | Akira Matsuda <ronnie@dio.jp> | 2012-06-05 04:59:34 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2012-06-06 19:33:38 +0900 |
commit | edee2c7b3bec824aa653b09d63aff06ab5542e06 (patch) | |
tree | e4cb8cbca333c14ce9ad2886e5c52a3791edb300 /activerecord | |
parent | 9fb70033d36f467d4eb858e9fac1282a0394876a (diff) | |
download | rails-edee2c7b3bec824aa653b09d63aff06ab5542e06.tar.gz rails-edee2c7b3bec824aa653b09d63aff06ab5542e06.tar.bz2 rails-edee2c7b3bec824aa653b09d63aff06ab5542e06.zip |
stop `to_s`ing method names
Module#methods are Symbols in Ruby >= 1.9
Diffstat (limited to 'activerecord')
-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 |