aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-08-22 14:13:10 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-08-22 14:13:10 -0700
commit744ed5c39381cb3e58eba6fab21f42b3408dce53 (patch)
tree6199b7e3735dc84917749cf68b9ed43170a1f53f /activerecord/lib
parent998d9c89e42d41f99b1970ce229cc4b818db3680 (diff)
parent646bfe1a5e7b30863e5ab8a5927246be3a69ed3b (diff)
downloadrails-744ed5c39381cb3e58eba6fab21f42b3408dce53.tar.gz
rails-744ed5c39381cb3e58eba6fab21f42b3408dce53.tar.bz2
rails-744ed5c39381cb3e58eba6fab21f42b3408dce53.zip
Merge pull request #11971 from freerunningtechnologies/dynamic_respond_to
Performance regression in AR::Base.respond_to?
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/dynamic_matchers.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/dynamic_matchers.rb b/activerecord/lib/active_record/dynamic_matchers.rb
index 3bac31c6aa..e650ebcf64 100644
--- a/activerecord/lib/active_record/dynamic_matchers.rb
+++ b/activerecord/lib/active_record/dynamic_matchers.rb
@@ -35,7 +35,7 @@ module ActiveRecord
end
def pattern
- /^#{prefix}_([_a-zA-Z]\w*)#{suffix}$/
+ @pattern ||= /\A#{prefix}_([_a-zA-Z]\w*)#{suffix}\Z/
end
def prefix