+
+ def self._index_requires_parameters
+ {
+ where: { type: 'object', required: false },
+ order: { type: 'string', required: false }
+ }
+ end
+
+ def client_accepts_plain_text_stream
+ (request.headers['Accept'].split(' ') &
+ ['text/plain', '*/*']).count > 0
+ end
+
+ def render *opts
+ response = opts.first[:json]
+ if response.is_a?(Hash) &&
+ params[:_profile] &&
+ Thread.current[:request_starttime]
+ response[:_profile] = {
+ request_time: Time.now - Thread.current[:request_starttime]
+ }
+ end
+ super *opts
+ end