From 1b07344efbfca0d813f5efa05d88fa606ddd96b0 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Thu, 20 Aug 2015 01:45:57 +0300 Subject: [PATCH] Actually send an email when a proposition is created --- app/models/proposition.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/proposition.rb b/app/models/proposition.rb index 0a3f365..95a9910 100644 --- a/app/models/proposition.rb +++ b/app/models/proposition.rb @@ -1,11 +1,11 @@ class Proposition < ActiveRecord::Base belongs_to :proposer, class_name: 'User' belongs_to :proposable, polymorphic: true - enum status: [:undecided, :approved, :rejected, :backup] - delegate :proposable_title, :proposable_type, :proposable_description, to: :proposable + after_create :send_creation_notification + def send_creation_notification PropositionMailer.new_proposition_notification(self).deliver_later end