law 0.1.5 → 0.1.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 +4 -4
- data/lib/law/legalize.rb +1 -1
- data/lib/law/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e67ef53ed650ad660d2b3f09d31dffdeab041efabbef8b92806a9b097e461ae7
|
|
4
|
+
data.tar.gz: 199118b8857009f2a95d8236ccecbb5b1ed3a0419bcf1587f83e309c42bee56e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
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.
|
|
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-
|
|
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.
|
|
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
|