Sha256: f2bffa2cea88d461c04d27469fbe9ace1e69ffa14c85f1c4e549a0858b574bca

Contents?: true

Size: 455 Bytes

Versions: 3

Compression:

Stored size: 455 Bytes

Contents

require 'spec_helper'
use_roles_strategy :one_role

class User
  include DataMapper::Resource  
  include Roles::DataMapper 
  
  strategy :one_role, :default 
  role_class :role
  property :id, Serial
  property :name, String   
end

DataMapper.finalize
DataMapper.auto_migrate!

User.valid_roles_are :admin, :guest, :user

# def api_migrate
#   migrate('roles_mask')
# end

def api_name
  :one_role
end

load 'roles_data_mapper/strategy/api_examples.rb'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
roles_data_mapper-0.2.2 spec/roles_data_mapper/strategy/single/one_role_spec.rb
roles_data_mapper-0.2.1 spec/roles_data_mapper/strategy/single/one_role_spec.rb
roles_data_mapper-0.2.0 spec/roles_data_mapper/strategy/single/one_role_spec.rb