lib/models/events/instance.rb in spektrix-0.0.1 vs lib/models/events/instance.rb in spektrix-0.0.2.1

- old
+ new

@@ -4,10 +4,11 @@ class Instance include Spektrix::Base collection_path "instances" after_find ->(r) do + # parse times [:start, :start_utc, :start_selling_at, :start_selling_at_utc, :stop_selling_at, @@ -22,17 +23,26 @@ end r.send(:"#{field}=",time) end end + + # we make price_list an actual Spektrix::Tickets:PriceList, but keep the original for reference + r.price_list_id = r.price_list[:id].to_i + end def status InstanceStatus.where(instance_id: self.id).first end - def prices - Tickets::PriceList.where(instance_id: self.id).first.prices + def price_list + Tickets::PriceList.where(instance_id: self.id).first end + + def event_object + Event.where(event_id: event[:id]).first + end + end end end \ No newline at end of file