add reference to multi-role querying to the README

This commit is contained in:
Martin Rehfeld 2010-08-17 14:00:31 +02:00
parent 02364a4e06
commit 402ef2ed22

View file

@ -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