law 0.1.5 → 0.1.6

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: 0b0b434177cd64675d5c94ad0ce5a25cd68e29d381320b06df44def8ba4749dd
4
- data.tar.gz: fa0dec022a5174b587299ba8bbeacde58ed05050593c404805c0bf8afd82c8cc
3
+ metadata.gz: e67ef53ed650ad660d2b3f09d31dffdeab041efabbef8b92806a9b097e461ae7
4
+ data.tar.gz: 199118b8857009f2a95d8236ccecbb5b1ed3a0419bcf1587f83e309c42bee56e
5
5
  SHA512:
6
- metadata.gz: b03be210deacc8a7eab971bbe4073c803a8cb9e7a4493afd7f689f62fa0eda5e6461135f869295dfffb57b44cc46c3ee21537c633971ddf2b9905bd9450e703f
7
- data.tar.gz: c9ffa4c048f433bef6d7cd12b9decfe028252751b8ed66fa677e0cd94e8e0215089059347bdb9cdc3e9639d6664027f3496c1411c9af2b73a25869dd793708b6
6
+ metadata.gz: c046693f76fa2d2c9cc08b6dc3846f40e092d4b2b883157b9ff04a7b33a9babc84f84de63b073edea6c6dba27fa210aecba5c2e90fc02055c6bfbbdf252402df
7
+ data.tar.gz: 79ee249005e98819df978ebdada33295591f3cbed3b945316b23699c50fea2281ec92bb25bc1c874b001ce88d57b0a526da56118155ecd4d0360497f88c6d5b4
data/lib/law/legalize.rb CHANGED
@@ -23,7 +23,7 @@ module Law
23
23
  end
24
24
 
25
25
  def law(object = nil, petitioner = nil, permissions: nil, parameters: nil, law_class: nil)
26
- object ||= try(:controller_name)&.singularize&.camelize&.safe_constantize
26
+ object ||= @record || try(:controller_name)&.singularize&.camelize&.safe_constantize
27
27
  petitioner ||= try(:current_user)
28
28
  permissions ||= petitioner.try(:permissions)
29
29
  law_class ||= object.try(:conjugate, Law::LawBase)
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.5"
4
+ VERSION = "0.1.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: law
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside
8
+ - Brandon Trumpold
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2020-03-04 00:00:00.000000000 Z
12
+ date: 2020-04-02 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: activesupport
@@ -172,6 +173,7 @@ description: Enforce the laws of your Rails application with highly extensible a
172
173
  policies
173
174
  email:
174
175
  - garside@gmail.com
176
+ - brandon.trumpold@gmail.com
175
177
  executables: []
176
178
  extensions: []
177
179
  extra_rdoc_files: []
@@ -228,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
230
  - !ruby/object:Gem::Version
229
231
  version: '0'
230
232
  requirements: []
231
- rubygems_version: 3.0.3
233
+ rubygems_version: 3.1.2
232
234
  signing_key:
233
235
  specification_version: 4
234
236
  summary: Give illegal operations a whole new meaning with this policy enforcement