1
0
Fork 0
This repository has been archived on 2023-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/db/seeds.rb

20 lines
577 B
Ruby
Raw Normal View History

2018-12-01 18:42:36 +00:00
# frozen_string_literal: true
country_states_filename = Rails.root.join 'config', 'country_states.txt'
country_state_names = File.readlines(country_states_filename).map(&:strip)
country_state_names.each do |name|
next if CountryState.where(name: name).exists?
CountryState.create! name: name
end
2018-12-04 01:57:16 +00:00
admin_account = Account.create!
admin_account.create_user!(
2018-12-05 18:31:57 +00:00
email: Rails.application.credentials.initial_superuser_email,
password: Rails.application.credentials.initial_superuser_password,
2018-12-04 01:57:16 +00:00
confirmed_at: Time.zone.now,
)
2018-12-06 02:28:47 +00:00
admin_account.add_role :superuser