aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-01-21 03:08:19 -0800
committerJosé Valim <jose.valim@gmail.com>2012-01-21 03:08:19 -0800
commitc05f3b0e4f6c5b2b350828e5e3cf9d0b1146562f (patch)
treea2e75982e4129af1363d6cbed22fa2d1079a882f /activesupport/lib
parent2e13850e4c8245214568b7e133908af7db9dbb9f (diff)
parentbb1813cab859a404ffbb0bc8077407632b92a2f1 (diff)
downloadrails-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.rb5
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