bitroles 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -9
- data/lib/bitroles/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -31,17 +31,14 @@ class MyModel < ActiveRecord::Base
|
|
31
31
|
has_roles :admin, :moderator, mask_column: :someothercolumn
|
32
32
|
end
|
33
33
|
```
|
34
|
-
## Available
|
35
|
-
```ruby
|
36
|
-
MyModel.with_role(:admin) # Scope that finds all MyModel objects with admin role
|
37
|
-
```
|
38
|
-
|
39
|
-
## Available instance methods
|
34
|
+
## Available methods
|
40
35
|
|
41
36
|
```ruby
|
42
|
-
|
43
|
-
|
44
|
-
|
37
|
+
objects = MyModel.with_role(:admin) # Finds all MyModel objects with admin role
|
38
|
+
obj = objects.first
|
39
|
+
obj.has_role? :admin # Checks if the object has admin role
|
40
|
+
obj.is_admin? # Checks the above. It can be is_moderator? or is_whatever? depends on roles given to has_role
|
41
|
+
obj.roles # Shows all roles of object (strings array)
|
45
42
|
obj.roles = [:admin, :moderator] # Sets admin and moderator role to obj
|
46
43
|
obj.admin = true # obj became admin (same for other roles)
|
47
44
|
obj.admin = false # obj is no longer an admin (same for other roles)
|
data/lib/bitroles/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitroles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -65,5 +65,5 @@ rubyforge_project:
|
|
65
65
|
rubygems_version: 1.8.24
|
66
66
|
signing_key:
|
67
67
|
specification_version: 3
|
68
|
-
summary: Bitroles gem v0.1.
|
68
|
+
summary: Bitroles gem v0.1.1
|
69
69
|
test_files: []
|