Skip to content
Browse files

Merge pull request #4572 from semaperepelitsa/noregexp

Replace regexp matching with a simple string manipulation.
  • Loading branch information...
2 parents 2e13850 + bb1813c commit c05f3b0e4f6c5b2b350828e5e3cf9d0b1146562f @josevalim josevalim committed Jan 21, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 activesupport/lib/active_support/ordered_options.rb
View
5 activesupport/lib/active_support/ordered_options.rb
@@ -30,8 +30,9 @@ def [](key)
end
def method_missing(name, *args)
- if name.to_s =~ /(.*)=$/
- self[$1] = args.first
+ name_string = name.to_s
+ if name_string.chomp!('=')
+ self[name_string] = args.first
else
self[name]
end

0 comments on commit c05f3b0

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