Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer { do_stuff } instead of {do_stuff} [ci skip] #11268

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions activesupport/lib/active_support/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,12 @@ def expanded_key(key) # :nodoc:
case key
when Array
if key.size > 1
key = key.collect{|element| expanded_key(element)}
key = key.collect { |element| expanded_key(element) }
else
key = key.first
end
when Hash
key = key.sort_by { |k,_| k.to_s }.collect{|k,v| "#{k}=#{v}"}
key = key.sort_by { |k,_| k.to_s }.collect { |k,v| "#{k}=#{v}" }
end

key.to_param
Expand All @@ -542,7 +542,7 @@ def instrument(operation, key, options = nil)
if self.class.instrument
payload = { :key => key }
payload.merge!(options) if options.is_a?(Hash)
ActiveSupport::Notifications.instrument("cache_#{operation}.active_support", payload){ yield(payload) }
ActiveSupport::Notifications.instrument("cache_#{operation}.active_support", payload) { yield(payload) }
else
yield(nil)
end
Expand Down