trabajo-afectivo/db/seeds.rb

40 lines
1.3 KiB
Ruby
Raw Normal View History

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)
# clear old caches to start from scratch
Cache.clear
# 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]
# loop over and load all seedfiles
# files will get executed automatically
seeds.each do |seed|
# we use load here to be able to re-seed in one process (test env)
load Rails.root.join('db', 'seeds', "#{seed}.rb")
end
2016-10-19 03:20:00 +00:00
2016-01-19 22:30:23 +00:00
# reset primary key sequences
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',
alias: 'en',
name: 'English (United States)',
2015-07-01 08:50:42 +00:00
)
Locale.sync
Translation.sync
2015-09-22 14:48:43 +00:00
Calendar.init_setup
# install all packages in auto_install
2015-09-22 14:48:43 +00:00
Package.auto_install