Merge pull request #40 from sgmap/destroy_emails_with_procedure
Destroy emails with procedure
This commit is contained in:
commit
8f5f86b2f3
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ class Procedure < ActiveRecord::Base
|
||||||
MAIL_TEMPLATE_TYPES = %w(InitiatedMail ReceivedMail ClosedMail RefusedMail WithoutContinuationMail)
|
MAIL_TEMPLATE_TYPES = %w(InitiatedMail ReceivedMail ClosedMail RefusedMail WithoutContinuationMail)
|
||||||
|
|
||||||
MAIL_TEMPLATE_TYPES.each do |name|
|
MAIL_TEMPLATE_TYPES.each do |name|
|
||||||
has_one "#{name.underscore}".to_sym, class_name: "Mails::#{name}"
|
has_one "#{name.underscore}".to_sym, class_name: "Mails::#{name}", dependent: :destroy
|
||||||
define_method("#{name.underscore}_with_override") do
|
define_method("#{name.underscore}_with_override") do
|
||||||
self.send("#{name.underscore}_without_override") || Object.const_get("Mails::#{name}").default
|
self.send("#{name.underscore}_without_override") || Object.const_get("Mails::#{name}").default
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue