base_editing_bootstrap 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +10 -2
- data/app/policies/base_model_policy.rb +1 -1
- data/lib/base_editing_bootstrap/VERSION +1 -1
- data/spec/support/external_shared/pundit.rb +40 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 678f9ed5e165bf715f6e9523c7b9a29cd2d06ee4da800723a76b1efa61a5d747
|
4
|
+
data.tar.gz: 9a7e3297a6e03130d8cb2d1b769b91a37d20010a070fdab81dd0a029ddadfc65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86c848f6f307910302465e1a7840f0046ab855ee60f7545f9ac68f004041d4176cff5370e02dd32d02b253a754756f0d2416de2783a1b47395d6d3ebac8cbc24
|
7
|
+
data.tar.gz: 7259712a03b75b24489ef7b459ac137eb7101d7e045e4bec175640b24509bcf875bc979a9bb91e23e7ecb1f977dfce14b40c6779be2fda2f39ebca587a14d328
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
|
3
3
|
|
4
4
|
- - -
|
5
|
+
## 0.9.0 - 2024-06-16
|
6
|
+
#### Features
|
7
|
+
- Change default and docs for show - (f320698) - Marino Bonetti
|
8
|
+
|
9
|
+
- - -
|
10
|
+
|
5
11
|
## 0.8.0 - 2024-06-12
|
6
12
|
#### Documentation
|
7
13
|
- Update Documentation - (1c7c723) - Marino Bonetti
|
data/README.md
CHANGED
@@ -190,12 +190,20 @@ Policy
|
|
190
190
|
require 'rails_helper'
|
191
191
|
##
|
192
192
|
# - check_default_responses default false, to check default responses
|
193
|
-
#
|
194
|
-
#
|
193
|
+
#
|
194
|
+
# on true all are true
|
195
|
+
# [:show?, true],
|
195
196
|
# [:destroy?, true],
|
196
197
|
# [:update?, true],
|
197
198
|
# [:create?, true],
|
198
199
|
# [:index?, true],
|
200
|
+
#
|
201
|
+
# when hash keys are:
|
202
|
+
# - show
|
203
|
+
# - destroy
|
204
|
+
# - update
|
205
|
+
# - create
|
206
|
+
# - index
|
199
207
|
#
|
200
208
|
RSpec.describe ServicePolicy, type: :policy do
|
201
209
|
it_behaves_like "a standard base model policy", :service, check_default_responses: false
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.9.0
|
@@ -19,12 +19,47 @@ RSpec.shared_examples "a standard base model policy" do |factory, check_default_
|
|
19
19
|
|
20
20
|
describe "standard_methods" do
|
21
21
|
where(:method, :response) do
|
22
|
+
|
23
|
+
if check_default_responses == true
|
24
|
+
checks = {
|
25
|
+
show: true,
|
26
|
+
destroy: true,
|
27
|
+
update: true,
|
28
|
+
create: true,
|
29
|
+
index: true
|
30
|
+
}
|
31
|
+
elsif check_default_responses.is_a? Hash
|
32
|
+
checks = check_default_responses
|
33
|
+
elsif check_default_responses == false
|
34
|
+
checks = {}
|
35
|
+
else
|
36
|
+
raise <<-MESSAGE.strip_heredoc
|
37
|
+
Acceptable values for check_default_responses are:
|
38
|
+
- true
|
39
|
+
- false
|
40
|
+
- Hash with:
|
41
|
+
show
|
42
|
+
destroy
|
43
|
+
update
|
44
|
+
create
|
45
|
+
index
|
46
|
+
MESSAGE
|
47
|
+
end
|
48
|
+
|
49
|
+
checks.reverse_merge!(
|
50
|
+
show: true,
|
51
|
+
destroy: true,
|
52
|
+
update: true,
|
53
|
+
create: true,
|
54
|
+
index: true
|
55
|
+
)
|
56
|
+
|
22
57
|
[
|
23
|
-
[:show?,
|
24
|
-
[:destroy?,
|
25
|
-
[:update?,
|
26
|
-
[:create?,
|
27
|
-
[:index?,
|
58
|
+
[:show?, checks[:show]],
|
59
|
+
[:destroy?, checks[:destroy]],
|
60
|
+
[:update?, checks[:update]],
|
61
|
+
[:create?, checks[:create]],
|
62
|
+
[:index?, checks[:index]],
|
28
63
|
]
|
29
64
|
end
|
30
65
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: base_editing_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marino Bonetti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|