0
0
Fork 0

Merge remote-tracking branch 'origin/master' into merge-upstream

Conflicts:
	app/controllers/auth/confirmations_controller.rb
This commit is contained in:
David Yip 2017-12-30 17:20:07 -06:00
commit 4cca1d1e7e
No known key found for this signature in database
GPG key ID: 7DA0036508FCC0CC
23 changed files with 190 additions and 27 deletions

View file

@ -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