Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove unused captures

  • Loading branch information...
commit 0c356109ff5e3b146641de7f1f823fee7c75bb41 1 parent 642752c
@tenderlove tenderlove authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.