Skip to content

Commit

Permalink
do not create default admin user if it exists (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
kowal committed Sep 17, 2019
1 parent ce05fed commit 1677b21
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# admin users
# envs: DEV
if Rails.env.development?
admin = AdminUser.find_or_create_by!(email: 'admin@example.com')
admin.update!(password: 'password', password_confirmation: 'password') if admin.new_record?
if Rails.env.development? && !AdminUser.find_by(email: 'admin@example.com')
AdminUser.create!(email: 'admin@example.com', password: 'password', password_confirmation: 'password')
end

# sectors: names & CP benchmarks units (optional)
Expand Down

0 comments on commit 1677b21

Please sign in to comment.