Mail Template: Delete

This commit is contained in:
Simon Lehericey 2017-03-06 16:52:07 +01:00
parent 2536774519
commit 335caed65e
4 changed files with 5 additions and 84 deletions

View file

@ -1,5 +1,6 @@
class DeleteAllMailValidatedInDb < ActiveRecord::Migration[5.0]
def change
MailTemplate.where(type: "MailValidated").delete_all
mail_template_exist = Object.const_get(:MailTemplate).is_a?(Class) rescue false
MailTemplate.where(type: "MailValidated").delete_all if mail_template_exist
end
end