Fix Style/ConditionalAssignment errors

They did not get excluded by `--auto-gen-config`
This commit is contained in:
Hernan Schmidt 2017-07-14 14:12:54 +02:00 committed by Hernán Schmidt
parent 523203ac74
commit d9a3b0de72
5 changed files with 31 additions and 31 deletions

View file

@ -29,11 +29,11 @@ class TicketPurchase < ActiveRecord::Base
conference.tickets.each do |ticket|
quantity = purchases[ticket.id.to_s].to_i
# if the user bought the ticket and is still unpaid, just update the quantity
if ticket.bought?(user) && ticket.unpaid?(user)
purchase = update_quantity(conference, quantity, ticket, user)
else
purchase = purchase_ticket(conference, quantity, ticket, user)
end
purchase = if ticket.bought?(user) && ticket.unpaid?(user)
update_quantity(conference, quantity, ticket, user)
else
purchase_ticket(conference, quantity, ticket, user)
end
if purchase && !purchase.save
errors.push(purchase.errors.full_messages)