diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-21 03:08:19 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-21 03:08:19 -0800 |
commit | c05f3b0e4f6c5b2b350828e5e3cf9d0b1146562f (patch) | |
tree | a2e75982e4129af1363d6cbed22fa2d1079a882f /activesupport/lib | |
parent | 2e13850e4c8245214568b7e133908af7db9dbb9f (diff) | |
parent | bb1813cab859a404ffbb0bc8077407632b92a2f1 (diff) | |
download | rails-c05f3b0e4f6c5b2b350828e5e3cf9d0b1146562f.tar.gz rails-c05f3b0e4f6c5b2b350828e5e3cf9d0b1146562f.tar.bz2 rails-c05f3b0e4f6c5b2b350828e5e3cf9d0b1146562f.zip |
Merge pull request #4572 from semaperepelitsa/noregexp
Replace regexp matching with a simple string manipulation.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/ordered_options.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/ordered_options.rb b/activesupport/lib/active_support/ordered_options.rb index bf81567d22..9e5a5d0246 100644 --- a/activesupport/lib/active_support/ordered_options.rb +++ b/activesupport/lib/active_support/ordered_options.rb @@ -30,8 +30,9 @@ module ActiveSupport #:nodoc: 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 |