diff options
author | John Hawthorn <john@freerunningtechnologies.com> | 2013-08-20 19:27:17 -0700 |
---|---|---|
committer | John Hawthorn <john@freerunningtechnologies.com> | 2013-08-21 18:18:26 -0700 |
commit | 646bfe1a5e7b30863e5ab8a5927246be3a69ed3b (patch) | |
tree | cdf3eea3e490190ef60db06aaf18a526c3250643 /activerecord/test/cases | |
parent | 9208338b0f982e9776f29caeb46795c4cd9207a1 (diff) | |
download | rails-646bfe1a5e7b30863e5ab8a5927246be3a69ed3b.tar.gz rails-646bfe1a5e7b30863e5ab8a5927246be3a69ed3b.tar.bz2 rails-646bfe1a5e7b30863e5ab8a5927246be3a69ed3b.zip |
Avoid compiling regexs in AR::Base.respond_to?
Caches the patterns of ActiveRecord::DynamicMatchers in a class instance
variable.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/finder_respond_to_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_respond_to_test.rb b/activerecord/test/cases/finder_respond_to_test.rb index 6101eb7b68..3ff22f222f 100644 --- a/activerecord/test/cases/finder_respond_to_test.rb +++ b/activerecord/test/cases/finder_respond_to_test.rb @@ -21,6 +21,11 @@ class FinderRespondToTest < ActiveRecord::TestCase assert_respond_to Topic, :find_by_title end + def test_should_respond_to_find_by_with_bang + ensure_topic_method_is_not_cached(:find_by_title!) + assert_respond_to Topic, :find_by_title! + end + def test_should_respond_to_find_by_two_attributes ensure_topic_method_is_not_cached(:find_by_title_and_author_name) assert_respond_to Topic, :find_by_title_and_author_name |