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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 802b8f61367034b56061929f500f33545ec77aa4ff508620e86bab14a1b86d56
|
|
4
|
+
data.tar.gz: 2c8eb033c0c83c1b0dfa266b1f4b65f9d06b9c6e48119846a2274f0658c12440
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 88e31f6363de1418c9b43e305b63020d69494496a7da9e56f3741fd04c79580e7b61ffbccae4fb8889f805b6a7ee80b4c12ba0f031d365ec9b19c5ec49e37682
|
|
7
|
+
data.tar.gz: 846b19d055d9911b65a63d86b9aecab5144a8751e6684788ff7d20c68c6eaec2aa80036977aa7c1d1cc19ad18cd7ef74136968139753b4244a05ab72dab28a15
|
data/Gemfile.lock
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
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)
|