Skip to content

Commit

Permalink
Merge pull request #19033 from d-m-u/seeding_notification_types_save_…
Browse files Browse the repository at this point in the history
…cleanup

Cleanup the save for notification type seeding
  • Loading branch information
bdunne authored Jul 23, 2019
2 parents 31e12c3 + ffc45b6 commit 874397d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions app/models/notification_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,9 @@ def self.names

def self.seed
seed_data.each do |t|
rec = find_by(:name => t[:name])
t[:expires_in] = t[:expires_in].to_i_with_method
if rec.nil?
create(t)
else
rec.update_attributes(t)
rec.save!
end
rec = find_by(:name => t[:name]) || new
rec.update!(t)
end
end

Expand Down

0 comments on commit 874397d

Please sign in to comment.