orbit4-5/config/environment.rb

48 lines
1.1 KiB
Ruby
Raw Normal View History

# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
2014-04-14 03:27:09 +00:00
Orbit::Application.initialize!
2014-04-21 02:48:36 +00:00
if Site.count == 0
site = Site.new
2014-05-01 08:44:01 +00:00
site.title_translations = {:en=>"Orbit",:zh_tw=>"Orbit"}
2014-04-21 02:48:36 +00:00
site.valid_locales = [:en, :zh_tw]
site.in_use_locales = site.valid_locales
site.save
end
2014-04-14 03:27:09 +00:00
if Page.count == 0
home = Page.new
home.name_translations = {:en=>"home",:zh_tw=>"首頁"}
2014-05-01 08:44:01 +00:00
home.url = "/"
2014-04-14 03:27:09 +00:00
home.save
end
2014-04-21 02:48:36 +00:00
if User.count==0
2014-05-12 08:18:35 +00:00
group = Workgroup.new
group.title = "Administrator"
group.key = 'admin'
group.save
role = Role.new
role.key = 'admin'
role.title_translations = {:en=>'Administrator', :zh_tw=>'Administrator'}
role.save
profile = MemberProfile.new
profile.first_name_translations = {:en=>'Digital', :zh_tw=>'Digital'}
profile.last_name_translations = {:en=>'Ruling', :zh_tw=>'Ruling'}
profile.save
role.member_profiles << profile
2014-04-21 02:48:36 +00:00
user = User.new
2014-05-12 08:18:35 +00:00
user.workgroup = group
user.member_profile = profile
2014-04-21 02:48:36 +00:00
user.user_name = "rulingcom"
user.password = "bjo4xjp6"
user.email = "orbit@rulingcom.com"
user.save
end