Sha256: 6b0f516cc4e2958a702e7967ab9cead72cc86367a05ed2e6c78136393f73fcfc

Contents?: true

Size: 442 Bytes

Versions: 5

Compression:

Stored size: 442 Bytes

Contents

require 'spec_helper'
use_roles_strategy :admin_flag

class User
  include DataMapper::Resource  
  include Roles::DataMapper 
  
  strategy :admin_flag, :default
  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
  :admin_flag
end

load 'roles_data_mapper/strategy/api_examples.rb'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
roles_data_mapper-0.3.1 spec/roles_data_mapper/strategy/single/admin_flag_spec.rb
roles_data_mapper-0.3.0 spec/roles_data_mapper/strategy/single/admin_flag_spec.rb
roles_data_mapper-0.2.2 spec/roles_data_mapper/strategy/single/admin_flag_spec.rb
roles_data_mapper-0.2.1 spec/roles_data_mapper/strategy/single/admin_flag_spec.rb
roles_data_mapper-0.2.0 spec/roles_data_mapper/strategy/single/admin_flag_spec.rb