Class: Api::V5::LoyaltyLevelsController
- Inherits:
-
BaseController
- Object
- ActionController::API
- BaseController
- Api::V5::LoyaltyLevelsController
- Defined in:
- app/controllers/api/v5/loyalty_levels_controller.rb
Overview
typed: ignore frozen_string_literal: true
Constant Summary
Constants inherited from BaseController
BaseController::CACHE_NAMESPACE, BaseController::INTERNAL_SERVER_ERROR_MESSAGE, BaseController::ResponseSchema
Instance Method Summary collapse
Methods inherited from BaseController
Methods included from LogrageCustomLogger
Methods included from ResponseCacheConcern
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/api/v5/loyalty_levels_controller.rb', line 5 def index cache_key = "#{CACHE_NAMESPACE}:#{self.class}:index:#{LoyaltyLevel.maximum(:updated_at)}:#{MyLocaleManager.normalize_locale}" my_response_cache cache_key, :json, public: true do json = render_to_string json: LoyaltyLevel.all, each_serializer: Api::V5::LoyaltyLevelSerializer, adapter: :json_api Oj.load(json).merge(success: true, message: nil) end end |