Merge remote-tracking branch 'origin/master' into merge-upstream
Conflicts: app/controllers/auth/confirmations_controller.rb
This commit is contained in:
commit
4cca1d1e7e
23 changed files with 190 additions and 27 deletions
|
@ -196,4 +196,13 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def render_cached_json(cache_key, **options)
|
||||
data = Rails.cache.fetch(cache_key, { raw: true }.merge(options)) do
|
||||
yield.to_json
|
||||
end
|
||||
|
||||
expires_in options[:expires_in], public: true
|
||||
render json: data
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue