Skip to content

Commit

Permalink
Update email reseed implementation to avoid purge old email templates
Browse files Browse the repository at this point in the history
  • Loading branch information
perryzjc committed Feb 28, 2024
1 parent 7464961 commit c3bc1fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

require_relative "seed_data"

EmailTemplate.delete_all
SeedData.emails.each { |email| EmailTemplate.create!(email) }
SeedData.emails.each do |email_attrs|
# to, body fields are updated through development, should be be used as part of the uniqueness check
email_template = EmailTemplate.find_or_initialize_by(email_attrs.except(:to, :body))
email_template.update(email_attrs)
end

SeedData.create_schools

Expand Down

0 comments on commit c3bc1fb

Please sign in to comment.