active_element 0.0.5 → 0.0.6

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: 55c4ed1b8eb3233fc4c071184ac145f01888d72b751fafafa68ff32873600e15
4
- data.tar.gz: ce1fba3786c8b1084678a26f27bb72107fdfec3de8dec53e6ccf4d45e32d526c
3
+ metadata.gz: 802b8f61367034b56061929f500f33545ec77aa4ff508620e86bab14a1b86d56
4
+ data.tar.gz: 2c8eb033c0c83c1b0dfa266b1f4b65f9d06b9c6e48119846a2274f0658c12440
5
5
  SHA512:
6
- metadata.gz: 5f3461c71414a3264a4e8911e642a5ca2fddbcf8cb456eef49f777a86eae69b094a35e7e133401428d4168062198a88fe63e6c909e62dab46ca965d00d7aa85e
7
- data.tar.gz: 469fb951cb7ccd0ab11ebb54b207d2c59ca5a8fbe2fc06f49d3ef58aaff69389870ec39e48b2c243a503ac036ae8d198e19c6120b7a4d881ba56a5b839f66e0f
6
+ metadata.gz: 88e31f6363de1418c9b43e305b63020d69494496a7da9e56f3741fd04c79580e7b61ffbccae4fb8889f805b6a7ee80b4c12ba0f031d365ec9b19c5ec49e37682
7
+ data.tar.gz: 846b19d055d9911b65a63d86b9aecab5144a8751e6684788ff7d20c68c6eaec2aa80036977aa7c1d1cc19ad18cd7ef74136968139753b4244a05ab72dab28a15
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_element (0.0.5)
4
+ active_element (0.0.6)
5
5
  bootstrap (~> 5.3.0alpha3)
6
6
  kaminari (~> 1.2)
7
7
  paintbrush (~> 0.1.2)
@@ -16,7 +16,7 @@ module ActiveElement
16
16
  @active_element ||= ActiveElement::ControllerInterface.new(self.class, self)
17
17
  end
18
18
 
19
- before_action -> { active_element.authenticator&.call }
19
+ before_action -> { active_element.authenticate }
20
20
  before_action -> { ActiveElement::ControllerAction.new(self).process_action }
21
21
 
22
22
  helper_method :active_element
@@ -35,11 +35,14 @@ module ActiveElement
35
35
 
36
36
  def authorize_with(&block)
37
37
  @authorize = true
38
- @current_user = block.call
38
+ state[:authorizor] = block
39
39
  end
40
40
 
41
41
  def authenticate
42
42
  authenticator&.call
43
+ @current_user = state[:authorizor]&.call
44
+
45
+ nil
43
46
  end
44
47
 
45
48
  def permit_action(action, with: nil, always: false)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveElement
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_element
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell