petergate 1.0.1 → 1.0.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: c3955dd64ab0e68946033b9f5b28adc57a3bbe0e
4
- data.tar.gz: bf67e237b5bf27e5bf2f3e6dd96fbb09096cf7df
3
+ metadata.gz: 02fcc936703a7764d3e360c97fd577d2bb9c2ff2
4
+ data.tar.gz: 0d71fa88703d732bd82a790ae16eae8e1c6890ad
5
5
  SHA512:
6
- metadata.gz: 586c85235b3d327142b98abf32550ab445e4cb81cc129baba6bb9f8129e1f0e6da07dc75444ee0ca51dd82c2a4b35ef9f6c01dfa94f20720bb3b51c3553403f5
7
- data.tar.gz: 9a713a1a3529f83794c8fb8023bc5b1a1b7b640f5b50c2097920039bbb89e594a7bcff3dc7637b79774792b1d8417a994b3874c23f9f872d4c62d80915b77b63
6
+ metadata.gz: 906c4d8507b98f3bc0e8b512bf6e878f07e4757c63795091408775e4fdc480caf6c31fd4b8210d26ec6584ff37f9735432cb0a7b0b5bfe8cfbad9f752cecbe1b
7
+ data.tar.gz: 5f0622280f7d006c159f5fda9881de0f6ef4bea4d69d8bdd25ad7f3a0e391704a9ffedefcc6e83b9ca2b9957b618225391ca55b2640175c104dac0ffe71f14f9
data/README.md CHANGED
@@ -53,7 +53,7 @@ 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: ALLREST
57
57
  ```
58
58
 
59
59
  Inside your views you can use logged_in?(:admin, :customer, :etc) to show or hide content.
@@ -68,7 +68,8 @@ If you need to access available roles within your project you can by calling:
68
68
  User::ROLES
69
69
  # or from an instance
70
70
  User.first.available_roles
71
- # ROLES is a CONSTANT and will still work from within the User model instance methods like in this default setter:
71
+ # ROLES is a CONSTANT and will still work from within the User model instance methods
72
+ # like in this default setter:
72
73
 
73
74
  def roles=(v)
74
75
  self[:roles] = v.map(&:to_sym).to_a.select{|r| r.size > 0 && ROLES.include?(r)}
data/lib/petergate.rb CHANGED
@@ -4,6 +4,12 @@ require "petergate/railtie"
4
4
  module Petergate
5
5
  module ControllerMethods
6
6
  module ClassMethods
7
+ def const_missing(const_name)
8
+ super unless const_name == :AllRest
9
+ warn "`AllRest` has been deprecated. Use `ALLREST` instead."
10
+ ALLREST
11
+ end
12
+
7
13
  def access(rules = {}, &block)
8
14
  if block
9
15
  b_rules = block.call
@@ -27,7 +33,7 @@ module Petergate
27
33
  end
28
34
 
29
35
  # Look into using Controller.action_methods instead
30
- AllRest = [:show, :index, :new, :edit, :update, :create, :destroy]
36
+ ALLREST = [:show, :index, :new, :edit, :update, :create, :destroy]
31
37
 
32
38
  def self.included(base)
33
39
  base.extend(ClassMethods)
@@ -1,3 +1,3 @@
1
1
  module Petergate
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
data/petergate.gemspec CHANGED
@@ -19,5 +19,5 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_development_dependency "bundler", "~> 1.7"
21
21
  spec.add_development_dependency "rake", "~> 10.0"
22
- spec.add_dependency 'activerecord', "~> 4.1.7"
22
+ spec.add_dependency 'activerecord', "> 4.0.0"
23
23
  end
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.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Sloan
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: activerecord
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">"
46
46
  - !ruby/object:Gem::Version
47
- version: 4.1.7
47
+ version: 4.0.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">"
53
53
  - !ruby/object:Gem::Version
54
- version: 4.1.7
54
+ version: 4.0.0
55
55
  description: If you like the straight forward and effective nature of Strong Parameters
56
56
  and suspect that CanCan might be overkill for your project then you'll love Petergate's
57
57
  easy to use and read action and content based authorizations.