app/controllers/sales_controller.rb in artfully_ose-1.2.0.pre.5 vs app/controllers/sales_controller.rb in artfully_ose-1.2.0.pre.6
- old
+ new
@@ -7,26 +7,25 @@
redirect_to new_event_show_sales_path(@event, @show)
end
def new
@person = Person.new
- @sale = Sale.new(@show, @show.chart.ticket_types.box_office, current_cart.becomes(BoxOffice::Cart), {})
+ @sale = Sale.new(@show, @show.chart.ticket_types.box_office, current_box_office_cart, {})
@tickets_remaining = tickets_remaining
setup_defaults
end
def create
- current_cart.becomes(BoxOffice::Cart).clear!
- @sale = Sale.new(@show, @show.chart.ticket_types.box_office, current_cart.becomes(BoxOffice::Cart), params[:quantities])
+ current_box_office_cart.clear!
+ @sale = Sale.new(@show, @show.chart.ticket_types.box_office, current_box_office_cart, params[:quantities])
if checking_out?
if @sale.sell(payment)
@sale.message = "Sold #{self.class.helpers.pluralize(@sale.tickets.length, 'ticket')}. Order total was #{self.class.helpers.number_as_cents @sale.cart.total}"
end
end
unless @sale.errors.empty?
@sale.error = "#{@sale.errors.full_messages.to_sentence.capitalize}."
- ExpireTicketJob.new(@sale.cart.tickets).perform
end
render :json => @sale.as_json
.merge(:total => @sale.cart.total)
.merge(:tickets_remaining => tickets_remaining)