Payment dashboard wasn't properly displaying. This fix corrects that.

This commit is contained in:
Eric Schultz 2019-02-22 16:13:41 -06:00
parent e3b88b39eb
commit 4e7df82f71

View file

@ -47,9 +47,9 @@ end
node(:ticket) do |payment| node(:ticket) do |payment|
event = GetData.obj(payment.tickets.last, :event) event = payment&.tickets&.last&.event
h = { h = {
event: {name: GetData.obj(event, :name), url: GetData.obj(event, :url), id: GetData.obj(event, :id)}, event: {name: event&.name, url: event&.url, id: event&.id},
levels: payment.tickets.map{|t| "#{GetData.chain(t.ticket_level, :name)} (#{t.quantity}x)"}.join(", "), levels: payment.tickets.map{|t| "#{GetData.chain(t.ticket_level, :name)} (#{t.quantity}x)"}.join(", "),
discount: payment.tickets.map{|t| t.event_discount ? "#{t.event_discount.name} (#{t.event_discount.percent}%)" : nil}.compact.join(", ") discount: payment.tickets.map{|t| t.event_discount ? "#{t.event_discount.name} (#{t.event_discount.percent}%)" : nil}.compact.join(", ")
} }