Class: OwnerDecorator

Inherits:
Draper::Decorator
  • Object
show all
Includes:
OwnerDashboardPaths
Defined in:
app/decorators/owner_decorator.rb

Overview

typed: ignore frozen_string_literal: true

Instance Method Summary collapse

Methods included from OwnerDashboardPaths

#dashboard_v2_block_inventories_path, #dashboard_v2_confirm_reservation_path, #dashboard_v2_create_or_update_inventories_path, #dashboard_v2_create_reservation_path, #dashboard_v2_edit_reservation_path, #dashboard_v2_filter_form_url, #dashboard_v2_group_voucher_marketplace_search_history, #dashboard_v2_group_voucher_marketplace_search_list, #dashboard_v2_inventories_path, #dashboard_v2_inventory_undo_path, #dashboard_v2_log_out_path, #dashboard_v2_new_reservation_path, #dashboard_v2_package_menus_path, #dashboard_v2_reports_path, #dashboard_v2_reservation_cancel_path, #dashboard_v2_reservation_send_reminder_path, #dashboard_v2_reservation_send_review_link_path, #dashboard_v2_reservations_path, #dashboard_v2_reset_inventories_path, #dashboard_v2_reviews_path, #dashboard_v2_root_path, #dashboard_v2_self_checkin_path, #dashboard_v2_self_redeem_path, #dashboard_v2_send_custom_sms_path, #dashboard_v2_staff_path, #dashboard_v2_staffs_path, #dashboard_v2_update_reservation_path, #dashboard_v2_voucher_marketplace_edit_history, #dashboard_v2_voucher_marketplace_history, #dashboard_v2_voucher_marketplace_list, #dashboard_v2_voucher_marketplace_redeem, #edit_dashboard_v2_staff_path, #many_restaurants?, #new_dashboard_v2_staff_path, #override_report_dashboard_v2_inventories_path, #partner_path, #restaurant_group_id_hash, #restaurant_id_hash

Instance Method Details

#dashboard_v2_restaurant_nameObject



29
30
31
# File 'app/decorators/owner_decorator.rb', line 29

def dashboard_v2_restaurant_name
  object.restaurant.name
end

#delivery_restaurant?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'app/decorators/owner_decorator.rb', line 33

def delivery_restaurant?
  object.restaurant.is_take_away?
end

#dine_in_restaurant?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'app/decorators/owner_decorator.rb', line 37

def dine_in_restaurant?
  object.restaurant.is_dine_in?
end

#fetch_restaurant_idsObject



25
26
27
# File 'app/decorators/owner_decorator.rb', line 25

def fetch_restaurant_ids
  [restaurant.id]
end

#reservationsObject



21
22
23
# File 'app/decorators/owner_decorator.rb', line 21

def reservations
  ::Reservation.where(restaurant_id: restaurant.id).exclude_temporary
end

#restaurantsObject

Define presentation-specific methods here. Helpers are accessed through `helpers` (aka `h`). You can override attributes, for example:

def created_at
  helpers. :span, class: 'time' do
    object.created_at.strftime("%a %m/%d/%y")
  end
end


17
18
19
# File 'app/decorators/owner_decorator.rb', line 17

def restaurants
  Restaurant.where(id: restaurant.id)
end