api: support the expiry param on all GET requests.
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
class ApplicationResponder < ActionController::Responder
|
||||
# this is called by respond_with for non-html, non-js responses.
|
||||
def to_format
|
||||
if get?
|
||||
expiry = request.params["expiry"]
|
||||
controller.expires_in expiry.to_i.days if expiry.present?
|
||||
end
|
||||
|
||||
if format == :xml
|
||||
options[:root] ||= resource.table_name.dasherize if resource.respond_to?(:table_name)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user