diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-19 17:08:53 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-19 17:08:53 -0800 |
commit | 0c356109ff5e3b146641de7f1f823fee7c75bb41 (patch) | |
tree | 23ebd9571724670d48f01c1951cd387fdd7b136c /activemodel/lib | |
parent | 642752c54dd953f18a0f876964c93ee0e8e9a52a (diff) | |
download | rails-0c356109ff5e3b146641de7f1f823fee7c75bb41.tar.gz rails-0c356109ff5e3b146641de7f1f823fee7c75bb41.tar.bz2 rails-0c356109ff5e3b146641de7f1f823fee7c75bb41.zip |
remove unused captures
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/attribute_methods.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index 432f3d4302..52f270ff33 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -325,14 +325,14 @@ module ActiveModel end @prefix, @suffix = options[:prefix] || '', options[:suffix] || '' - @regex = /^(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})$/ + @regex = /^(?:#{Regexp.escape(@prefix)})(.*)(?:#{Regexp.escape(@suffix)})$/ @method_missing_target = "#{@prefix}attribute#{@suffix}" @method_name = "#{prefix}%s#{suffix}" end def match(method_name) if @regex =~ method_name - AttributeMethodMatch.new(method_missing_target, $2, method_name) + AttributeMethodMatch.new(method_missing_target, $1, method_name) else nil end |