petergate 0.1.14 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/README.md +7 -2
- data/lib/petergate.rb +2 -8
- data/lib/petergate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 957ee14ef64ca5211f9d42069de46a3f4429cc2d
|
4
|
+
data.tar.gz: 56bfd569f9a262fa639eebe303c3fd5644f7f195
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d4a0d01c213460ea78e9fec901b6baeea947df053672fd251f7c5ea9ce1e4ddb471b846bbef10f42451ea759dcabc89ad56d4fe17abc94e0dadd41fbee33a1d
|
7
|
+
data.tar.gz: adf7ce67254f24cc83741eb9080a8c483f51d6fd4b2a4c13a199233059a4da01b39d673a9df8b94f17cf55cddf3bf200fb37e8081ca87c276cbf1ba83cb6e95f
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -48,8 +48,13 @@ If you need to access available roles within your project you can by calling:
|
|
48
48
|
|
49
49
|
```ruby
|
50
50
|
User::ROLES
|
51
|
-
# or
|
52
|
-
User.available_roles
|
51
|
+
# or from an instance
|
52
|
+
User.first.available_roles
|
53
|
+
# ROLES is a CONSTANT and will still work from within the User model instance methods like in this default setter:
|
54
|
+
|
55
|
+
def roles=(v)
|
56
|
+
self[:roles] = v.map(&:to_sym).to_a.select{|r| r.size > 0 && ROLES.include?(r)}
|
57
|
+
end
|
53
58
|
```
|
54
59
|
|
55
60
|
|
data/lib/petergate.rb
CHANGED
@@ -78,19 +78,13 @@ module PeterGate
|
|
78
78
|
end
|
79
79
|
|
80
80
|
instance_eval do
|
81
|
-
|
82
|
-
|
83
|
-
def available_roles
|
84
|
-
@available_roles
|
85
|
-
end
|
86
|
-
|
87
|
-
const_set('ROLES', available_roles)
|
81
|
+
const_set('ROLES', options[:roles])
|
88
82
|
end
|
89
83
|
|
90
84
|
|
91
85
|
class_eval do
|
92
86
|
def available_roles
|
93
|
-
self.class
|
87
|
+
self.class::ROLES
|
94
88
|
end
|
95
89
|
|
96
90
|
def roles=(v)
|
data/lib/petergate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: petergate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Isaac Sloan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|