Class: DoorList

Inherits:
Object
  • Object
show all
Extended by:
ArtfullyOseHelper
Defined in:
app/models/door_list.rb

Defined Under Namespace

Classes: Item

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ArtfullyOseHelper

action_and_subtype, amount_and_nongift, bootstrapped_type, build_order_location, channel_checkbox, channel_text, check_mark, contextual_menu, credit_card_message, date_field_tag, datetime_field_tag, events_to_options, full_details, fully_qualified_asset_path, get_selected_class, icon_link_to, icon_tag, link_to_add_fields, link_to_remove_fields, nav_dropdown, number_as_cents, number_to_dollars, select_event_for_sales_search, select_show_for_sales_search, sorted_us_state_abbreviations, sorted_us_state_names, ticket_seller_name, time_zone_description, us_states, verb_for_save, widget_script

Methods included from LinkHelper

#active?, #active_link_to, #active_section, #in_section, #in_sub_section

Constructor Details

#initialize(show) ⇒ DoorList

Returns a new instance of DoorList.



5
6
7
# File 'app/models/door_list.rb', line 5

def initialize(show)
  @show = show
end

Instance Attribute Details

#showObject (readonly)

Returns the value of attribute show.



2
3
4
# File 'app/models/door_list.rb', line 2

def show
  @show
end

Instance Method Details

#itemsObject



13
14
15
# File 'app/models/door_list.rb', line 13

def items
  @items ||= tickets.map { |t| Item.new t, t.buyer }.sort
end

#ticketsObject



9
10
11
# File 'app/models/door_list.rb', line 9

def tickets
  @tickets ||= Ticket.where(:show_id => show.id).includes(:buyer, :cart, :section, :items => :order).select(&:committed?)
end