Sha256: 913951d05e4fbce2d6d1d239df895f763fafea90f9cb5ff089ad57896256dc1e

Contents?: true

Size: 587 Bytes

Versions: 3

Compression:

Stored size: 587 Bytes

Contents

class Bootstrap
  def self.reset_database
    RightOn::Right.delete_all
    RightOn::Role.delete_all
    User.delete_all

    basic_right = RightOn::Right.create!(:name => 'basic', :controller => 'basic')
    admin_right = RightOn::Right.create!(:name => 'admin', :controller => 'admin')
    basic_role  = RightOn::Role.create!(:title => 'Basic', :rights => [basic_right])
    admin_role  = RightOn::Role.create!(:title => 'Admin', :rights => [admin_right])

    User.create!(name: 'basic', roles: [basic_role])
    User.create!(name: 'admin', roles: [basic_role, admin_role])
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
right_on-0.3.0 spec/support/bootstrap.rb
right_on-0.2.0 spec/support/bootstrap.rb
right_on-0.1.0 spec/support/bootstrap.rb