petergate 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/petergate/active_record/base.rb +10 -4
- 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: 7366ce69bda79a5c0b5072f2f7413684239650d8
|
4
|
+
data.tar.gz: 87805e112d8097aae45ddb19c11537f1aab07d24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5879d63794e172de154b8562e6bea4f4303a0b02c8a3f4b5adf682d8412aedf0d32fd46abcabc3f600ad0bc050b827031661f9cd659e1a0650da057e18fd3b61
|
7
|
+
data.tar.gz: bd050cc3a0b0fc0b5fdd21e6430f9c4d9f54414299e58bb75d649c0a4be973b6afaa968ca24937df99d1027dfcf894e059e0496bc08addd967de5bc54789e366
|
@@ -19,10 +19,9 @@ module Petergate
|
|
19
19
|
end
|
20
20
|
|
21
21
|
instance_eval do
|
22
|
-
const_set('ROLES', (roles + [:user]).uniq)
|
22
|
+
const_set('ROLES', (roles + [:user]).uniq) unless defined?(User::ROLES)
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
25
|
class_eval do
|
27
26
|
def available_roles
|
28
27
|
self.class::ROLES
|
@@ -41,9 +40,16 @@ module Petergate
|
|
41
40
|
v.first
|
42
41
|
end
|
43
42
|
end
|
43
|
+
end
|
44
44
|
|
45
|
-
|
46
|
-
|
45
|
+
def roles
|
46
|
+
case self[:roles].class.to_s
|
47
|
+
when "String", "Symbol"
|
48
|
+
[self[:roles].to_sym, :user]
|
49
|
+
when "Array"
|
50
|
+
super
|
51
|
+
else
|
52
|
+
[:user]
|
47
53
|
end
|
48
54
|
end
|
49
55
|
|
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: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Isaac Sloan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|