Actually send an email when a proposition is created

This commit is contained in:
Petko Bordjukov 2015-08-20 01:45:57 +03:00
parent 4d7b3aea6c
commit 1b07344efb
1 changed files with 2 additions and 2 deletions

View File

@ -1,11 +1,11 @@
class Proposition < ActiveRecord::Base class Proposition < ActiveRecord::Base
belongs_to :proposer, class_name: 'User' belongs_to :proposer, class_name: 'User'
belongs_to :proposable, polymorphic: true belongs_to :proposable, polymorphic: true
enum status: [:undecided, :approved, :rejected, :backup] enum status: [:undecided, :approved, :rejected, :backup]
delegate :proposable_title, :proposable_type, :proposable_description, to: :proposable delegate :proposable_title, :proposable_type, :proposable_description, to: :proposable
after_create :send_creation_notification
def send_creation_notification def send_creation_notification
PropositionMailer.new_proposition_notification(self).deliver_later PropositionMailer.new_proposition_notification(self).deliver_later
end end