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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bc623aff4e968f13e93888f5de948b843cb511d
4
- data.tar.gz: c36afe33348380bdd7d2390b94d345f7a53a56ea
3
+ metadata.gz: 7366ce69bda79a5c0b5072f2f7413684239650d8
4
+ data.tar.gz: 87805e112d8097aae45ddb19c11537f1aab07d24
5
5
  SHA512:
6
- metadata.gz: 075913d5d41b9565357c12c55ac16ee5664d8ee434cdf362ace283db8c3e1bc38a7ad84c1c67c71cf067b6e6fd16a467ec313d52d351b4f5249606e53e3c580d
7
- data.tar.gz: 7624aebda00c0237c2f25fd8b4d2e4cc6729150a45d36dc88cd6a0da34f9da0e2e8fc28da359635015ba345a205fdab88c8e3895a8e2871ed1ee73c35cfe39c6
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
- def roles
46
- Array(self[:roles].to_sym) | [:user]
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
 
@@ -1,3 +1,3 @@
1
1
  module Petergate
2
- VERSION = "1.5.2"
2
+ VERSION = "1.5.3"
3
3
  end
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.2
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-14 00:00:00.000000000 Z
11
+ date: 2016-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler