Module: CopperHelper
- Included in:
- Modules::Owners::Reports, PartnerService::Reports::BaseService
- Defined in:
- app/helpers/copper_helper.rb
Overview
typed: ignore
Instance Method Summary collapse
-
#copper_sort_restaurants(restaurant_group) ⇒ Object
need to hard code to fix order on Copper Group account.
Instance Method Details
#copper_sort_restaurants(restaurant_group) ⇒ Object
need to hard code to fix order on Copper Group account. Requested by Surasit He wants to adjust group login - 253 to adjust the sort to be 4503 restaurant Id first for allotment n followed by 4502
6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/helpers/copper_helper.rb', line 6 def copper_sort_restaurants(restaurant_group) if restaurant_group.id == 253 restaurants = restaurant_group.restaurants.to_a first = Restaurant.find 4503 second = Restaurant.find 4502 restaurants.reject! {|restaurant| restaurant.id == 4503 || restaurant.id == 4502 } [first, second, restaurants].flatten else restaurant_group.restaurants.includes(:translations) end end |