Class: Yes::Read::Api::ApplicationController

Inherits:
ActionController::API
  • Object
show all
Defined in:
app/controllers/yes/read/api/application_controller.rb

Direct Known Subclasses

QueriesController

Instance Method Summary collapse

Instance Method Details

#append_info_to_payload(payload) ⇒ Object



13
14
15
16
17
18
19
# File 'app/controllers/yes/read/api/application_controller.rb', line 13

def append_info_to_payload(payload)
  super
  payload[:request_id] = request.uuid
  payload[:request_headers] = request.env.select do |k, _v|
    k.match(/\A(HTTP.*|CONTENT.*|REMOTE.*|REQUEST.*|AUTHORIZATION.*|SCRIPT.*|SERVER.*)/)
  end
end

#set_localeObject



9
10
11
# File 'app/controllers/yes/read/api/application_controller.rb', line 9

def set_locale
  I18n.locale = params[:locale] || I18n.default_locale
end