Fixing a few bugs

This commit is contained in:
Matt Barringer 2013-02-12 19:17:19 +01:00
parent 045ffd3541
commit df0e75e03a
4 changed files with 14 additions and 7 deletions

View file

@ -47,7 +47,7 @@ class Event < ActiveRecord::Base
transitions :to => :review, :from=>[:confirmed]
end
event :confirm do
transitions :to => :confirmed, :from => :unconfirmed
transitions :to => :confirmed, :from => :unconfirmed, :on_transition => :process_confirmation
end
event :cancel do
transitions :to => :canceled, :from => [:unconfirmed, :confirmed]
@ -98,6 +98,13 @@ class Event < ActiveRecord::Base
self.class.state_machine.events_for(self.current_state).include?(transition)
end
def process_confirmation
if self.conference.email_settings.send_on_confirmed_without_registration?
if self.conference.registrations.where(:person_id => self.submitter.id).first.nil?
Mailbot.confirm_reminder_mail(self).deliver
end
end
end
def process_acceptance(options)
if options[:send_mail] == "true"
Rails.logger.debug "Sending acceptance mail"