Merge branch 'master' into fix-sponsor-caching

This commit is contained in:
James Mason 2018-01-31 09:56:44 -08:00 committed by GitHub
commit a5c80ad6e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 3 deletions

View file

@ -115,3 +115,9 @@ p.comment-body {
float: right;
}
}
/* omniauth btn grp */
#openid-btn-grp{
display: flex;
justify-content: center;
}

View file

@ -62,7 +62,11 @@ class Ticket < ApplicationRecord
def tickets_turnover_total(id)
tickets = TicketPurchase.where(ticket_id: id).paid
tickets.inject(0){ |sum, ticket| sum + (ticket.amount_paid * ticket.quantity) }
if tickets.blank?
Money.new(0, Ticket.find(id).price_currency)
else
tickets.inject(Money.new(0, tickets.first.price_currency)){ |sum, ticket| sum + (ticket.amount_paid * ticket.quantity) }
end
end
def tickets_sold

View file

@ -1,5 +1,5 @@
.text-center
.btn-group.btn-group-lg
.btn-group.btn-group-lg#openid-btn-grp
- omniauth_configured.each do |provider|
= link_to "user_#{provider}_omniauth_authorize".to_sym, class: "btn btn-success btn-lg",
id: "omniauth-#{provider}",

View file

@ -496,7 +496,7 @@ ActiveRecord::Schema.define(version: 20171201163628) do
t.integer "user_id"
t.integer "payment_id"
t.integer "week"
t.float "amount_paid"
t.float "amount_paid", default: 0.0
end
create_table "ticket_scannings", force: :cascade do |t|