strong_actions 0.2.1 → 0.2.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
  SHA256:
3
- metadata.gz: fdae0a8c14b6469d215869817d425b2eff058e5f5dec21a917907fcf3f2db64f
4
- data.tar.gz: d8d4cbbdc46d75781563efdaa72386cb606dac64e8ef72abb5119c27c45ef1e5
3
+ metadata.gz: 0ec80274a548a13c7dcf92f9e02cce6c53171d6da19b72069991c3150593d595
4
+ data.tar.gz: 71677591fa9bc6a043955003cfa50dc1be496c14a3e1fb4a7101ebb915d32ca4
5
5
  SHA512:
6
- metadata.gz: 4b3c1c3659fcdf6411e803babc9f420cd8702d053f41b224d8456ec0824f5dd952a9d94092f503bba65620d3ad8e3c54dffb0d819796d8e88d8ac80c19d15495
7
- data.tar.gz: cca6fcc202d2718a0232398f6b5568d8064b7262df6ff17ea462365acb71a39ed40128bfe6910c18b80c28285517ec4e2ebd3206d4e4e8bed210b4a7c59f3826
6
+ metadata.gz: d27a6b8606324d3e2c412bca7e2b24653de0a0ea70697d733f77bfa904dacd12e7fe260f6efb878f62a789f2a33f574aeaaf9552501c197e19f7ae970d8814d5
7
+ data.tar.gz: 85d817023355cb98c24157a528aae3d9996e38b3ebf630235dafcd7a3deeafa8c6aefe350a0734333866b89029f3f905f12b9e7636371c86ffde42ce0d9e0504
@@ -1,16 +1,11 @@
1
- require 'strong_actions/decision'
1
+ require_relative 'decision'
2
2
 
3
3
  module StrongActions
4
4
  module Controller
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
- if ::ActionPack::VERSION::MAJOR < 4
9
- before_filter :authorize_roles!
10
- else
11
- before_action :authorize_roles!
12
- end
13
-
8
+ before_action :authorize_roles!
14
9
  helper_method :available?
15
10
  end
16
11
 
@@ -27,6 +27,8 @@ module StrongActions
27
27
  return false if definition === false
28
28
 
29
29
  role_object = role_object_for(role)
30
+ return false unless role_object
31
+
30
32
  return false unless role_object.instance_eval(definition)
31
33
  end
32
34
 
@@ -1,3 +1,3 @@
1
1
  module StrongActions
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strong_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-28 00:00:00.000000000 Z
11
+ date: 2023-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport