Module: Api::V5::Concerns::GetRestaurantList

Included in:
BranchController, PagesController, RestaurantTagGroupsController, RestaurantTagsController, RestaurantsController
Defined in:
app/controllers/api/v5/concerns/get_restaurant_list.rb

Overview

Authorization functionality

Instance Method Summary collapse

Instance Method Details

#restaurant_list(named_cache_key, scope = :default) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/api/v5/concerns/get_restaurant_list.rb', line 8

def restaurant_list(named_cache_key, scope = :default)
  is_compact_mode = params[:compact_mode].to_s == 'true'

  if is_compact_mode
    compact_restaurant_list("#{named_cache_key}:#{I18n.locale}")
  elsif params[:by_recommendation].to_s == 'true'
    recommendation_restaurant_list("#{named_cache_key}:#{I18n.locale}", scope)
  else
    normal_restaurant_list("#{named_cache_key}:#{I18n.locale}", scope)
  end
end