1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Stop using inject({}) to build hashes. It is harder to read and slower.

This commit is contained in:
José Valim 2010-09-22 23:28:52 +02:00
parent fdb4cd5b38
commit 589de27bcd

View file

@ -122,10 +122,8 @@ module Devise
# Returns values from the request object.
def request_values
keys = request_keys.respond_to?(:keys) ? request_keys.keys : request_keys
keys.inject({}) do |hash, key|
hash[key] = self.request.send(key)
hash
end
values = keys.map { |k| self.request.send(k) }
Hash[keys.zip(values)]
end
# Parse authentication keys considering if they should be enforced or not.