Sha256: f8fd3938fcbbe545ebb4093d83a8395b7971fdb044ae38440354f474194deb17

Contents?: true

Size: 1.44 KB

Versions: 15

Compression:

Stored size: 1.44 KB

Contents

# Database initial data
ModelDiscovery::Engine.load_seed

#Faalis::Workflows::Discovery.build_table_list
Faalis::Discovery::Permissions.create_all_permissions

case Faalis::ORM.current
when 'active_record'
  admin_group = Faalis::Group.create(name: 'Admin', role: 'admin')
  guest_group = Faalis::Group.create(name: 'Guest', role: 'guest')

  admin_group.permissions = Faalis::Permission.all

  admin = Faalis::User.create(email: 'admin@example.com',
                              password: 'changeme',
                              password_confirmation: 'changeme')
  admin.groups << admin_group


  user = Faalis::User.create(email: 'user@example.com',
                             password: '123123123',
                             password_confirmation: '123123123')

when 'mongoid'
  admin_group = Faalis::Group.create(name: 'Admin', role: 'admin')
  Faalis::Permission.each do |perm|
    admin_group.permissions << perm
  end
  admin_group.save!

  guest_group = Faalis::Group.create(name: 'Guest', role: 'guest')

  admin = Faalis::User.new(email: 'admin@example.com',
                           password: 'changeme',
                           password_confirmation: 'changeme')


  admin.groups << admin_group

  user = Faalis::User.new(email: 'user@example.com',
                          password: '123123123',
                          password_confirmation: '123123123')

  guest_group = Faalis::Group.new(name: 'Guest', role: 'guest')

end

admin.save
user.save

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
faalis-2.2.0.pre.rc1 db/seeds.rb
faalis-2.2.1 db/seeds.rb
faalis-2.2.0 db/seeds.rb
faalis-2.1.1 db/seeds.rb
faalis-2.1.0 db/seeds.rb
faalis-2.0.8 db/seeds.rb
faalis-2.0.7 db/seeds.rb
faalis-2.0.5 db/seeds.rb
faalis-2.0.4 db/seeds.rb
faalis-2.0.3 db/seeds.rb
faalis-2.0.1 db/seeds.rb
faalis-2.0.0 db/seeds.rb
faalis-2.0.0.rc6 db/seeds.rb
faalis-2.0.0.rc5 db/seeds.rb
faalis-2.0.0.rc4 db/seeds.rb