Actually send an email when a proposition is created
This commit is contained in:
parent
4d7b3aea6c
commit
1b07344efb
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue