Skip to content
This repository has been archived by the owner on Aug 17, 2017. It is now read-only.

Commit

Permalink
Merge pull request #51 from geoffgarside/ruby18-issue39
Browse files Browse the repository at this point in the history
Fix Regexp.escape(filter) for Ruby 1.8.
  • Loading branch information
rafaelfranca committed Oct 24, 2012
2 parents 2e74169 + 79d0c0d commit 61e8789
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/action_controller/parameters.rb
Expand Up @@ -44,7 +44,7 @@ def permit(*filters)
case filter
when Symbol, String then
params[filter] = self[filter] if has_key?(filter)
keys.grep(/\A#{Regexp.escape(filter)}\(\d+[if]?\)\z/).each { |key| params[key] = self[key] }
keys.grep(/\A#{Regexp.escape(filter.to_s)}\(\d+[if]?\)\z/).each { |key| params[key] = self[key] }
when Hash then
self.slice(*filter.keys).each do |key, value|
return unless value
Expand Down

0 comments on commit 61e8789

Please sign in to comment.