Destroy emails with procedure
This commit is contained in:
parent
e501c2f23b
commit
fc9ef92c37
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.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
|
||||
self.send("#{name.underscore}_without_override") || Object.const_get("Mails::#{name}").default
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue