petergate 1.1.0 → 1.1.2

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: 7e071497b1d19cd9aef5830f86707336a1407ba4
4
- data.tar.gz: 58b569bbdda9a7d5680acbfa2c97e8a866ac9f43
3
+ metadata.gz: 1c6bb01335ae726fb9111f4e67114216130876b2
4
+ data.tar.gz: ec55f513adceccfba351f00635895da22db55865
5
5
  SHA512:
6
- metadata.gz: 6321dfd8c5c5e647340c1f009b29e435a1a815a27e9cb961840482893c0769f7bcd249f027660760128c7d4065e3806651609de242da69453122854dcdd1a670
7
- data.tar.gz: 37845a553961fe7b55c6f203f3e72101bc7e24fa3703a76a18fa050a3de59b6ff89b352318c1184de629b07de0bbc17eb990b585ddfe8ec3b865891de1c6e2e4
6
+ metadata.gz: b8e3d3549fd6985170c2385c951e9cb5a6229e4811ba5055f1a67704cf42a2f0b65e123a3b2501be502f17f8cb7d9480db95c4a8ac3cac886ab52b97b4db4c50
7
+ data.tar.gz: 106830457161d0832a1b518417fbf3bc9fb7037ee8f6b68bb015f7f137f1ac13476f193a87741811cd243f9136301df6185762b782caf518671810881deecce9
data/README.md CHANGED
@@ -53,9 +53,9 @@ Usage
53
53
  Setup permissions in your controllers the same as you would for a before filter like so:
54
54
 
55
55
  ```ruby
56
- access all: [:show, :index], user: ALLREST
56
+ access all: [:show, :index], user: {except: [:destroy]}, company_admin: :all
57
57
 
58
- # one other options that might seem a bit weird is to put a group of roles in an array:
58
+ # one other option that might seem a bit weird is to put a group of roles in an array:
59
59
  access [:all, :user] => [:show, :index]
60
60
  ```
61
61
 
@@ -1,3 +1,3 @@
1
1
  module Petergate
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.2"
3
3
  end
data/lib/petergate.rb CHANGED
@@ -5,9 +5,12 @@ module Petergate
5
5
  module ControllerMethods
6
6
  module ClassMethods
7
7
  def const_missing(const_name)
8
- super unless const_name == :AllRest
9
- warn "`AllRest` has been deprecated. Use `ALLREST` instead."
10
- ALLREST
8
+ if [:AllRest, :ALLREST].include?(const_name)
9
+ warn "`AllRest` and `ALLREST` has been deprecated. Use :all instead."
10
+ return ALLRESTDEP
11
+ else
12
+ return super
13
+ end
11
14
  end
12
15
 
13
16
  def all_actions
@@ -40,8 +43,7 @@ module Petergate
40
43
  end
41
44
  end
42
45
 
43
- # Look into using Controller.action_methods instead
44
- ALLREST = [:show, :index, :new, :edit, :update, :create, :destroy]
46
+ ALLRESTDEP = [:show, :index, :new, :edit, :update, :create, :destroy]
45
47
 
46
48
  def self.included(base)
47
49
  base.extend(ClassMethods)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: petergate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Sloan