active_element 0.0.5 → 0.0.7

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: 55c4ed1b8eb3233fc4c071184ac145f01888d72b751fafafa68ff32873600e15
4
- data.tar.gz: ce1fba3786c8b1084678a26f27bb72107fdfec3de8dec53e6ccf4d45e32d526c
3
+ metadata.gz: 67016d55c760a93c399b7d63708d5d8630cb01540c267fd67b1265d36bb79626
4
+ data.tar.gz: 0177fb6d53c398aaee6dc568035379d4397c4be321c84de76619964e7a9cf325
5
5
  SHA512:
6
- metadata.gz: 5f3461c71414a3264a4e8911e642a5ca2fddbcf8cb456eef49f777a86eae69b094a35e7e133401428d4168062198a88fe63e6c909e62dab46ca965d00d7aa85e
7
- data.tar.gz: 469fb951cb7ccd0ab11ebb54b207d2c59ca5a8fbe2fc06f49d3ef58aaff69389870ec39e48b2c243a503ac036ae8d198e19c6120b7a4d881ba56a5b839f66e0f
6
+ metadata.gz: 22672e0631bf9b14bbed0d44c1d52e975b24b12855bdb2d8b89099007cd248a370054bbae3525a5d83610df510242129c59d3825f0b81ab4ed3db27167c3b9c3
7
+ data.tar.gz: 6c26e0ae71456eecd781cf0a111be6280c17f3348f5c26039cccd718c9246015cebabba31d093cb00987cf43c67c40a8eba9192893f403d0787b848f4ff4b4b3
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.7)
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
@@ -13,7 +13,7 @@ module ActiveElement
13
13
  Rails.logger.info("#{ActiveElement.log_tag} #{colorized_permissions_message}")
14
14
  return if verified_permissions?
15
15
 
16
- warn "#{log_tag} #{colorized_permissions_message}" if Rails.env.test?
16
+ warn "#{ActiveElement.log_tag} #{colorized_permissions_message}" if Rails.env.test?
17
17
  return controller.redirect_to redirect_path if redirect_to_default_landing_page?
18
18
 
19
19
  render_forbidden
@@ -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.7'
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.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell