demarches-normaliennes/db/seeds/super_admin.rb

8 lines
235 B
Ruby
Raw Normal View History

begin
Administration.create!(email: SUPERADMIN.email, password: SUPERADMIN.password)
rescue ActiveRecord::RecordInvalid
admin = Administration.find_by_email(SUPERADMIN.email)
admin.password = SUPERADMIN.password
admin.save
end