From 0c356109ff5e3b146641de7f1f823fee7c75bb41 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 19 Jan 2012 17:08:53 -0800 Subject: remove unused captures --- activemodel/lib/active_model/attribute_methods.rb | 4 ++-- 1 file 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 -- cgit v1.2.3