forked from saurabh/orbit4-5
48 lines
1.1 KiB
Ruby
48 lines
1.1 KiB
Ruby
# Load the Rails application.
|
|
require File.expand_path('../application', __FILE__)
|
|
|
|
# Initialize the Rails application.
|
|
Orbit::Application.initialize!
|
|
|
|
if Site.count == 0
|
|
site = Site.new
|
|
site.title_translations = {:en=>"Orbit",:zh_tw=>"Orbit"}
|
|
site.valid_locales = [:en, :zh_tw]
|
|
site.in_use_locales = site.valid_locales
|
|
site.save
|
|
end
|
|
|
|
if Page.count == 0
|
|
home = Page.new
|
|
home.name_translations = {:en=>"home",:zh_tw=>"首頁"}
|
|
home.url = "/"
|
|
home.save
|
|
end
|
|
|
|
if User.count==0
|
|
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
|
|
|
|
user = User.new
|
|
user.workgroup = group
|
|
user.member_profile = profile
|
|
user.user_name = "rulingcom"
|
|
user.password = "bjo4xjp6"
|
|
user.email = "orbit@rulingcom.com"
|
|
user.save
|
|
end
|