2012-04-10 13:31:21 +00:00
|
|
|
# This file should contain all the record creation needed to seed the database with its default values.
|
|
|
|
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
|
|
|
#
|
|
|
|
# Examples:
|
|
|
|
#
|
|
|
|
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
|
|
|
# Mayor.create(:name => 'Emanuel', :city => cities.first)
|
2016-11-08 13:15:24 +00:00
|
|
|
|
|
|
|
# clear old caches to start from scratch
|
|
|
|
Cache.clear
|
|
|
|
|
2017-04-26 11:28:32 +00:00
|
|
|
# this is the __ordered__ list of seed files
|
|
|
|
# extend only if needed - try to add your changes
|
|
|
|
# to the matching one of the existing files
|
2017-11-23 08:09:44 +00:00
|
|
|
seeds = %w[settings user_nr_1 signatures roles permissions groups links ticket_state_types ticket_states ticket_priorities ticket_article_types ticket_article_senders macros community_user_resources overviews channels report_profiles chats object_manager_attributes schedulers triggers karma_activities]
|
2017-04-26 11:28:32 +00:00
|
|
|
|
2018-09-28 12:15:42 +00:00
|
|
|
# loop over and load all seedfiles
|
2017-04-26 11:28:32 +00:00
|
|
|
# files will get executed automatically
|
|
|
|
seeds.each do |seed|
|
2018-09-28 12:15:42 +00:00
|
|
|
# we use load here to be able to re-seed in one process (test env)
|
|
|
|
load Rails.root.join('db', 'seeds', "#{seed}.rb")
|
2017-04-26 11:28:32 +00:00
|
|
|
end
|
2016-10-19 03:20:00 +00:00
|
|
|
|
2016-01-19 22:30:23 +00:00
|
|
|
# reset primary key sequences
|
2016-11-25 14:54:13 +00:00
|
|
|
DbHelper.import_post
|
2016-01-19 22:30:23 +00:00
|
|
|
|
2015-04-27 06:20:52 +00:00
|
|
|
# install locales and translations
|
2015-07-01 11:53:21 +00:00
|
|
|
Locale.create_if_not_exists(
|
2015-07-01 08:50:42 +00:00
|
|
|
locale: 'en-us',
|
2018-12-19 17:31:51 +00:00
|
|
|
alias: 'en',
|
|
|
|
name: 'English (United States)',
|
2015-07-01 08:50:42 +00:00
|
|
|
)
|
2016-12-03 19:37:37 +00:00
|
|
|
Locale.sync
|
|
|
|
Translation.sync
|
2017-04-26 11:28:32 +00:00
|
|
|
|
2015-09-22 14:48:43 +00:00
|
|
|
Calendar.init_setup
|
2013-01-07 08:34:03 +00:00
|
|
|
|
|
|
|
# install all packages in auto_install
|
2015-09-22 14:48:43 +00:00
|
|
|
Package.auto_install
|