Sha256: b83a3a4ea0d106e8c36b31efafcf1bf288ae1fd1ce529843d03d7ed4a66d389c

Contents?: true

Size: 832 Bytes

Versions: 21

Compression:

Stored size: 832 Bytes

Contents

# encoding: utf-8

def insert_user  
  User.truncate!
  password = Rails.env.production? ? Devise.friendly_token : (1..9).to_a.join
  
  admin = User.new do |u|
    u.name = "Administrator"
    u.email = 'dev@fodojo.com'
    u.password = password
    u.password_confirmation = password
    u.login = 'admin' if u.respond_to?(:login)
    u.role_type = RoleType.admin
  end
    
  admin.skip_confirmation!
  admin.save!

  puts "Admin: #{admin.email}, #{admin.password}"
end

def insert_structures
  Structure.truncate!
  
  main_page = Structure.create!(title: "Главная страница", slug: "main-page", structure_type: StructureType.main, parent: nil)
  # Structure.create!(title: "Трансляции", slug: "broadcasts", structure_type: StructureType.broadcasts, parent: main_page)
end

insert_user
insert_structures

Version data entries

21 entries across 18 versions & 1 rubygems

Version Path
sunrise-cms-1.0.0 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-1.0.0.rc3 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-1.0.0.rc2 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-1.0.0.rc1 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.7.0.rc2 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.7.0.rc1 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.6.11 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.6.10 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.6.9 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.6.8 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.6.7 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.6.6 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.6.5 spec/tmp/db/seeds.rb
sunrise-cms-0.6.5 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.6.4 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.6.4 spec/tmp/db/seeds.rb
sunrise-cms-0.6.3 spec/tmp/db/seeds.rb
sunrise-cms-0.6.3 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.6.2 lib/generators/sunrise/templates/config/seeds.rb
sunrise-cms-0.6.1 lib/generators/sunrise/templates/config/seeds.rb