five-two-nw-olivander 0.2.0.35 → 0.2.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20309038b9a2b17f545f6c06658c87f41fc20a565b8d39b6c079894add49c644
4
- data.tar.gz: 5c6429e2fdd1204b7324b36a7c4cd118ea136229b23a56f9ded5cab92fab801a
3
+ metadata.gz: 20a2a1f0d91b619aa91cb6e5670939246a5471a40a1fdcc772934f11de447c7c
4
+ data.tar.gz: 010f45ad72e71c350fbbcf73385fe2b39b47458e613a7da714dfd9dd378a367d
5
5
  SHA512:
6
- metadata.gz: 248d5ca6b004d3f76c47b0a70e5268ec26970df86e7a0e45ba2879cf07468b0f9c71fb045321ccd76c7dea764252fc40a865de5a19a3b14c1f657045f6dedb39
7
- data.tar.gz: 884dd31cca4c245d24b227ca9ae2d7854d36059df578a70bb1325f76758ad87a1eb0b987273db88757d4e332028d277b5d659593dacc6f6b851762c6454f5663
6
+ metadata.gz: 7175c69a12f98b0b31e6525b87b8e51a2fe9a8c3a02b577617acfc741b184edcdd1323d896fe5317278a238ae71c97905e4f0a49270efdfa6ce837f6acd4ed14
7
+ data.tar.gz: 2fb042867661f164131bcdd36ebc74e8f7ed62e2711b20b2b0ee9f5c1290f85db9947ca8f745ca1cf1d3048bb4b901418c15337b014f9ce80564a8bd66a574af
@@ -36,8 +36,9 @@ module Olivander
36
36
  end
37
37
 
38
38
  def authorized_resource_actions(resource, for_action: :show)
39
+ action_klass = action_klass_for(resource)
39
40
  action_resource = action_resource_for(resource)
40
- raw_name = action_resource.name
41
+ raw_name = action_klass.name
41
42
  plural_name = raw_name.demodulize.underscore.pluralize
42
43
  routed_resource = Olivander::CurrentContext.application_context.route_builder.resources[plural_name.to_sym]
43
44
  return [] if routed_resource.nil?
@@ -63,9 +64,13 @@ module Olivander
63
64
  end
64
65
  end
65
66
 
66
- def action_resource_for(resource)
67
+ def action_klass_for(resource)
67
68
  klazz = resource.is_a?(Class) ? resource : resource.class
68
- klazz.respond_to?(:action_resource) ? klazz.action_resource : klazz
69
+ klazz.respond_to?(:action_klass) ? klazz.action_klass : klazz
70
+ end
71
+
72
+ def action_resource_for(resource)
73
+ resource.respond_to?(:action_resource) ? resource.action_resource : resource
69
74
  end
70
75
 
71
76
  def authorized_resource_action?(action, resource, except = nil)
@@ -2,5 +2,5 @@
2
2
 
3
3
  # needed for gem
4
4
  module Olivander
5
- VERSION = '0.2.0.35'
5
+ VERSION = '0.2.0.36'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: five-two-nw-olivander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.35
4
+ version: 0.2.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Dennis