lib/active_model/attribute_methods.rb in activemodel-3.2.11 vs lib/active_model/attribute_methods.rb in activemodel-3.2.12
- old
+ new
@@ -363,10 +363,10 @@
"automatically."
)
end
@prefix, @suffix = options[:prefix] || '', options[:suffix] || ''
- @regex = /^(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})$/
+ @regex = /\A(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})\z/
@method_missing_target = "#{@prefix}attribute#{@suffix}"
@method_name = "#{prefix}%s#{suffix}"
end
def match(method_name)