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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7e2945ef0bed8de2cf39e5360b284285ab4ccbb05516e1399c81ced429930cb
4
- data.tar.gz: b298df8948c5131c6593571a3c7ad7b88f0863b9c004a80466d5a108eb29d498
3
+ metadata.gz: e74cd15524ae8f0731bcb351779158496be3fa61a49e7e3553a53a0bfd5fdcff
4
+ data.tar.gz: fa7920650d8debe57a1bbcafa2b6cabf1e9b617783a3f22edc9568a9e7eea359
5
5
  SHA512:
6
- metadata.gz: 7afa64f62d6ad2899cd0204f4c58252cda6a35aea9a3802ce52cf8b85973cec72feaa585bd21de5df382efe6d87aff35d0167746f94a6dcc08523238164d7323
7
- data.tar.gz: 56b8c706eac2c46a6753d52110b0bd607aab8b91e8d90bc2ee5a1e0759ed5d2569bb667c33cad45f1097fb439c19e3780ffbe192beb3ade5f13995788fcc2c3e
6
+ metadata.gz: cb1bda1a9cfbbe9205453a318d2ef783e2adc62ce13bdea457e76c93f07194d4531265c0d3284eb866c722aed16853696d6283a7d590de5f8a90145ef441b7bd
7
+ data.tar.gz: 866e1524f3d77b29d872ade4758faa389889a114a6a287b68fae0772fa5371658a4be22cc9d5c1cdb87e6f046068c864a4af3838a5ed35cf965d8aadace18de8
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Law
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: law
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside