Class: Workarea::Api::Storefront::ApplicationController

Inherits:
Workarea::ApplicationController
  • Object
show all
Includes:
HttpCaching, Authentication
Defined in:
app/controllers/workarea/api/storefront/application_controller.rb

Instance Method Summary collapse

Methods included from Authentication

#authentication?, #current_user, find_user

Instance Method Details

#assert_current_metrics_idObject



31
32
33
34
35
36
37
38
39
40
41
42
# File 'app/controllers/workarea/api/storefront/application_controller.rb', line 31

def assert_current_metrics_id
  if current_metrics_id.blank?
    render(
      json: {
        problem: t('workarea.api.storefront.recent_views.missing_id')
      },
      status: :unprocessable_entity
    )

    return false
  end
end

#cache_pageObject



23
24
25
# File 'app/controllers/workarea/api/storefront/application_controller.rb', line 23

def cache_page
  expires_in Workarea.config.page_cache_ttl, public: true
end

#skip_sessionObject



27
28
29
# File 'app/controllers/workarea/api/storefront/application_controller.rb', line 27

def skip_session
  request.session_options[:skip] = true
end