Skip to content

Commit

Permalink
Fix Style/SafeNavigation cop (mastodon#32970)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski authored Nov 26, 2024
1 parent b702cd7 commit 6efa320
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/concerns/cache_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def enforce_cache_control!
def render_with_cache(**options)
raise ArgumentError, 'Only JSON render calls are supported' unless options.key?(:json) || block_given?

key = options.delete(:key) || [[params[:controller], params[:action]].join('/'), options[:json].respond_to?(:cache_key) ? options[:json].cache_key : nil, options[:fields].nil? ? nil : options[:fields].join(',')].compact.join(':')
key = options.delete(:key) || [[params[:controller], params[:action]].join('/'), options[:json].respond_to?(:cache_key) ? options[:json].cache_key : nil, options[:fields]&.join(',')].compact.join(':')
expires_in = options.delete(:expires_in) || 3.minutes
body = Rails.cache.read(key, raw: true)

Expand Down

0 comments on commit 6efa320

Please sign in to comment.