Class: Blgr::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
ElasticApmContext, LogrageCustomLogger
Defined in:
app/controllers/blgr/application_controller.rb

Instance Method Summary collapse

Methods included from LogrageCustomLogger

#append_info_to_payload

Instance Method Details

#identity_cache_memoization(&block) ⇒ Object



17
18
19
# File 'app/controllers/blgr/application_controller.rb', line 17

def identity_cache_memoization(&block)
  IdentityCache.cache.with_memoization(&block)
end

#set_select_dataObject



29
30
31
32
33
34
# File 'app/controllers/blgr/application_controller.rb', line 29

def set_select_data
  I18n.locale = params.fetch(:locale, :th)
  @select_restaurants = select_restaurants
  @select_groups = select_groups
  @select_branches = select_branches
end

#switch_locale(&action) ⇒ Object



23
24
25
26
27
# File 'app/controllers/blgr/application_controller.rb', line 23

def switch_locale(&action)
  I18n.with_locale(:en) do
    Globalize.with_locale(:en, &action)
  end
end