law 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/law/laws/actions.rb +1 -1
- data/lib/law/legalize.rb +2 -2
- data/lib/law/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e74cd15524ae8f0731bcb351779158496be3fa61a49e7e3553a53a0bfd5fdcff
|
4
|
+
data.tar.gz: fa7920650d8debe57a1bbcafa2b6cabf1e9b617783a3f22edc9568a9e7eea359
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb1bda1a9cfbbe9205453a318d2ef783e2adc62ce13bdea457e76c93f07194d4531265c0d3284eb866c722aed16853696d6283a7d590de5f8a90145ef441b7bd
|
7
|
+
data.tar.gz: 866e1524f3d77b29d872ade4758faa389889a114a6a287b68fae0772fa5371658a4be22cc9d5c1cdb87e6f046068c864a4af3838a5ed35cf965d8aadace18de8
|
data/lib/law/laws/actions.rb
CHANGED
@@ -7,7 +7,7 @@ module Law
|
|
7
7
|
extend ActiveSupport::Concern
|
8
8
|
|
9
9
|
included do
|
10
|
-
class_attribute :actions, instance_writer: false, default:
|
10
|
+
class_attribute :actions, instance_writer: false, default: HashWithIndifferentAccess.new
|
11
11
|
|
12
12
|
delegate :statute_for_action?, to: :class
|
13
13
|
end
|
data/lib/law/legalize.rb
CHANGED
@@ -33,8 +33,8 @@ module Law
|
|
33
33
|
law_class.new(permissions: permissions, source: petitioner, target: object, params: parameters)
|
34
34
|
end
|
35
35
|
|
36
|
-
def authorize!(**options)
|
37
|
-
authorize(**options) or raise Law::NotAuthorizedError
|
36
|
+
def authorize!(action = nil, **options)
|
37
|
+
authorize(action, **options) or raise Law::NotAuthorizedError
|
38
38
|
end
|
39
39
|
|
40
40
|
def authorize(action = nil, object: nil, petitioner: nil, permissions: nil, parameters: nil, law_class: nil)
|
data/lib/law/version.rb
CHANGED