Created
December 8, 2014 14:50
-
-
Save mattiasarro/a8652218ed1dd6c0d609 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/models/ticketing/ticket_transaction.rb b/app/models/ticketing/ticket_transaction.rb | |
index 50b3a3c..3a6ea7d 100644 | |
--- a/app/models/ticketing/ticket_transaction.rb | |
+++ b/app/models/ticketing/ticket_transaction.rb | |
@@ -48,12 +48,20 @@ class TicketTransaction < ActiveRecord::Base | |
def state_cleared | |
self.update_column(:cleared_at, DateTime.now) | |
+ complete! unless require_guest_names | |
end | |
def state_completed | |
self.transaction do | |
tickets.reserved.each do |ticket| | |
ticket.confirm! | |
+ TicketMailer.send_to_guest(ticket) | |
+ end | |
+ | |
+ if require_guest_names | |
+ TicketMailer.send_to_member(self.tickets.where(email: nil)) | |
+ else | |
+ TicketMailer.send_to_member(self.tickets) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment