Skip to content
Browse files

remove unused captures

  • Loading branch information...
1 parent 642752c commit 0c356109ff5e3b146641de7f1f823fee7c75bb41 @tenderlove tenderlove committed Jan 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 activemodel/lib/active_model/attribute_methods.rb
View
4 activemodel/lib/active_model/attribute_methods.rb
@@ -325,14 +325,14 @@ def initialize(options = {})
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

0 comments on commit 0c35610

Please sign in to comment.
Something went wrong with that request. Please try again.