Sha256: d9ab494bc9647fd1b25705248ebb7a4ae64a88d62ad944dd30ebec2f93fb9803

Contents?: true

Size: 979 Bytes

Versions: 13

Compression:

Stored size: 979 Bytes

Contents

def insert_user  
  User.truncate_table
  Role.truncate_table
  password = Devise.friendly_token
  
  admin = User.new(:name=>'Administrator', :email=>'dev@aimbulance.com',
                   :password=>password, :password_confirmation=>password)
  admin.login = 'admin' if admin.respond_to?(:login)
  admin.roles.build(:role_type => RoleType.admin)
  admin.skip_confirmation!
  admin.save!

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

def insert_structures
  Structure.truncate_table
  
  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)
  #Structure.create!(:title => "Прямые репортажи", :slug => "posts", :structure_type => StructureType.posts, :parent => main_page)
end

insert_user
insert_structures

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
sunrise-core-0.2.2 spec/dummy/db/seeds.rb
sunrise-core-0.2.1 spec/dummy/db/seeds.rb
sunrise-widgets-0.1.1 spec/dummy/db/seeds.rb
sunrise-locales-0.1.0 spec/dummy/db/seeds.rb
sunrise-core-0.2.0 spec/dummy/db/seeds.rb
sunrise-widgets-0.1.0 spec/dummy/db/seeds.rb
sunrise-questions-0.1.0 spec/dummy/db/seeds.rb
sunrise-core-0.1.5 lib/generators/sunrise/templates/config/seeds.rb
sunrise-core-0.1.4 lib/generators/sunrise/templates/config/seeds.rb
sunrise-core-0.1.3 lib/generators/sunrise/templates/config/seeds.rb
sunrise-core-0.1.2 lib/generators/sunrise/templates/config/seeds.rb
sunrise-core-0.1.1 lib/generators/sunrise/templates/config/seeds.rb
sunrise-core-0.1.0 lib/generators/sunrise/templates/config/seeds.rb