mirror of
https://github.com/Fishwaldo/role_model.git
synced 2025-03-15 19:42:43 +00:00
add reference to multi-role querying to the README
This commit is contained in:
parent
02364a4e06
commit
402ef2ed22
1 changed files with 8 additions and 1 deletions
|
@ -25,7 +25,7 @@ It works like this:
|
|||
end
|
||||
|
||||
#
|
||||
# Test drive
|
||||
# Test drive (check the RDoc or source for additional finesse)
|
||||
#
|
||||
|
||||
>> u = User.new
|
||||
|
@ -53,6 +53,13 @@ It works like this:
|
|||
>> u.has_role? :author # has_role? is also aliased to is?
|
||||
=> false
|
||||
|
||||
# ... check for multiple roles
|
||||
>> u.has_any_role? :author, :manager # has_any_role? is also aliased to is_any_of?
|
||||
=> true
|
||||
|
||||
>> u.has_all_roles? :author, :manager # has_all_roles? is also aliased to is?
|
||||
=> false
|
||||
|
||||
# see the internal bitmask representation (3 = 0b0011)
|
||||
>> u.roles_mask
|
||||
=> 3
|
||||
|
|
Loading…
Add table
Reference in a new issue