adeia 0.15.0 → 0.15.1

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
  SHA1:
3
- metadata.gz: a93bd33dfa2aa6851e05d96b480b48aaf05a5ba4
4
- data.tar.gz: 523e4a924d0ee0794ca1da1161d8f6fc45c4509b
3
+ metadata.gz: 605ce68d14c5ef2253c3781728549c7d2a1f3f96
4
+ data.tar.gz: 5676dd30928133149c7065863b8efde3d74670de
5
5
  SHA512:
6
- metadata.gz: ba8ba952a5954bcfec327216f8f1cf99d1651fc0cd635321b96448b233f2fae569c2f07196928ac704d8f987184b08f9f252d8a42bbd58794e835cda9dcebcbf
7
- data.tar.gz: c53e4b015e96531ef751ce4a686a00e91039f072d3737b908a4b7d38609d9afc35a865d9c4d3bf748d93c4982acdb15e5268b09cdc054e18931de901f6435e4b
6
+ metadata.gz: e71c77a3fa2bf4451eb47cccc57dba45b76e3d980b8f5e40d353439c8679c468148508cc18777b26ee85677393e96d3e0d67b6f32e571982b060b4a6a7d6ee9d
7
+ data.tar.gz: 46155469ad139615faac10e783d627e14166989d709e8dfda97b3184469a838a69fce00c65cad3028cc754eb4efab4f16214a84beca3b681e76925b771a7b0d3
@@ -7,22 +7,22 @@ module Adeia
7
7
 
8
8
  def self.add_before_filter(controller_class, method, **args)
9
9
  controller_class.send(:before_action, args.slice(:only, :except, :if, :unless)) do |controller|
10
- ControllerResource.send(method, controller)
10
+ ControllerResource.send(method, controller, **args)
11
11
  end
12
12
  end
13
13
 
14
- def self.load_resource_or_records_and_authorize(controller)
14
+ def self.load_resource_or_records_and_authorize(controller, **args)
15
15
  case controller.action_name
16
16
  when "index"
17
- controller.authorize_and_load_records!
17
+ controller.authorize_and_load_records!(**args)
18
18
  when "show", "edit", "update", "destroy"
19
- controller.load_and_authorize!
19
+ controller.load_and_authorize!(**args)
20
20
  else
21
- controller.authorize!
21
+ controller.authorize!(**args)
22
22
  end
23
23
  end
24
24
 
25
- def self.require_login(controller)
25
+ def self.require_login(controller, **args)
26
26
  controller.require_login!
27
27
  end
28
28
 
@@ -98,7 +98,11 @@ module Adeia
98
98
  begin
99
99
  @controller_name.classify.constantize
100
100
  rescue NameError
101
- @controller_name.classify.demodulize.constantize
101
+ begin
102
+ @controller_name.classify.demodulize.constantize
103
+ rescue NameError
104
+ nil
105
+ end
102
106
  end
103
107
  end
104
108
  end
data/lib/adeia/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Adeia
2
- VERSION = "0.15.0"
2
+ VERSION = "0.15.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adeia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - khcr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
11
+ date: 2017-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails