Sha256: f8d18e97fb3db9550af4aec31f38f5433d52021aaec95cf45d69157771397620

Contents?: true

Size: 626 Bytes

Versions: 7

Compression:

Stored size: 626 Bytes

Contents

# encoding: utf-8

def insert_user
  User.truncate!
  password = Rails.env.production? ? Devise.friendly_token : (1..8).to_a.join

  admin = User.new do |u|
    u.email = 'test@test.com'
    u.password = password
    u.password_confirmation = password
    u.user_role_id = UserRoleType.admin.id
  end

  admin.activate!
  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}, as: :admin)
end

insert_user
insert_structures

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ab_admin-0.3.6 lib/generators/ab_admin/install/templates/config/seeds.rb
ab_admin-0.3.5 lib/generators/ab_admin/install/templates/config/seeds.rb
ab_admin-0.3.4 lib/generators/ab_admin/install/templates/config/seeds.rb
ab_admin-0.3.3 lib/generators/ab_admin/install/templates/config/seeds.rb
ab_admin-0.3.2 lib/generators/ab_admin/install/templates/config/seeds.rb
ab_admin-0.3.1 lib/generators/ab_admin/install/templates/config/seeds.rb
ab_admin-0.3.0 lib/generators/ab_admin/install/templates/config/seeds.rb