base_editing_bootstrap 0.10.1 → 0.10.2
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/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/base_editing_bootstrap/VERSION +1 -1
- data/lib/base_editing_bootstrap/base_model.rb +2 -2
- data/spec/support/external_shared/base_model.rb +10 -4
- 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: 1e1b2b4d7acdd0cc339988fde4d7ce56578bc2cb692184c77cb47e90f256f2d7
|
|
4
|
+
data.tar.gz: 30b9e2672ac29a97722f1f163ee6ed5e7cb9473d5aac9f5ad85bdd9621e0b351
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e6d302e8a9d8e644b1eebfdccef92b85437651fb36f74264b38384afb0e237412858d3a86f58d81579b7b981c5891bad5706fb72e3c42b2b9c994fd3b907cb2
|
|
7
|
+
data.tar.gz: d32ad07d930010e7a7ae647619dcd42cd61ca4e30ffa86bde4f42c5be8a10a75102788f121217fe613972e083c4e2dea4b4c1a8667dbeb96430d220a20f73d59
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
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.10.2 - 2024-09-05
|
|
6
|
+
#### Bug Fixes
|
|
7
|
+
- Force to_s ransackable_attributes - (a5c8cbb) - Marino Bonetti
|
|
8
|
+
#### Documentation
|
|
9
|
+
- Typo - (2ba91c6) - Marino Bonetti
|
|
10
|
+
|
|
11
|
+
- - -
|
|
12
|
+
|
|
5
13
|
## 0.10.1 - 2024-07-25
|
|
6
14
|
#### Bug Fixes
|
|
7
15
|
- Change from controller_name to controller_path (#3) - (8b123a4) - Jury Ghidinelli
|
data/README.md
CHANGED
|
@@ -137,7 +137,7 @@ Utilizzo per modello base, in questo esempio prendiamo come modello Post come es
|
|
|
137
137
|
- Integer => _integer.html.erb
|
|
138
138
|
- Float => _decimal.html.erb
|
|
139
139
|
- Decimal => _decimal.html.erb
|
|
140
|
-
- DateTime =>
|
|
140
|
+
- DateTime => _datetime.html.erb
|
|
141
141
|
- Date => _date.html.erb
|
|
142
142
|
- Enum => _enum.html.erb
|
|
143
143
|
Per gli enum, le traduzioni dei labels di ogni valore provvengono da i18n
|
|
@@ -1 +1 @@
|
|
|
1
|
-
0.10.
|
|
1
|
+
0.10.2
|
|
@@ -12,9 +12,9 @@ module BaseEditingBootstrap
|
|
|
12
12
|
class_methods do
|
|
13
13
|
def ransackable_attributes(auth_object = nil)
|
|
14
14
|
if auth_object
|
|
15
|
-
Pundit.policy(auth_object, self.new).permitted_attributes_for_ransack
|
|
15
|
+
Pundit.policy(auth_object, self.new).permitted_attributes_for_ransack.map(&:to_s)
|
|
16
16
|
else
|
|
17
|
-
Pundit.policy(User.new, self.new).permitted_attributes_for_ransack
|
|
17
|
+
Pundit.policy(User.new, self.new).permitted_attributes_for_ransack.map(&:to_s)
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
@@ -3,13 +3,19 @@ RSpec.shared_examples "a base model" do |ransack_permitted_attributes: [], ransa
|
|
|
3
3
|
it_behaves_like "a validated? object"
|
|
4
4
|
|
|
5
5
|
describe "with ransackables" do
|
|
6
|
-
where(:base_model_method, :policy_method, :result) do
|
|
6
|
+
where(:base_model_method, :policy_method, :policy_output, :result) do
|
|
7
7
|
[
|
|
8
8
|
[
|
|
9
|
-
:ransackable_attributes, :permitted_attributes_for_ransack, ransack_permitted_attributes
|
|
9
|
+
:ransackable_attributes, :permitted_attributes_for_ransack, ransack_permitted_attributes.map(&:to_s), ransack_permitted_attributes.map(&:to_s)
|
|
10
10
|
],
|
|
11
11
|
[
|
|
12
|
-
:
|
|
12
|
+
:ransackable_attributes, :permitted_attributes_for_ransack, ransack_permitted_attributes.map(&:to_sym), ransack_permitted_attributes.map(&:to_s)
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
:ransackable_associations, :permitted_associations_for_ransack,ransack_permitted_associations.map(&:to_s), ransack_permitted_associations.map(&:to_s)
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
:ransackable_associations, :permitted_associations_for_ransack, ransack_permitted_associations.map(&:to_sym), ransack_permitted_associations.map(&:to_s)
|
|
13
19
|
]
|
|
14
20
|
]
|
|
15
21
|
end
|
|
@@ -23,7 +29,7 @@ RSpec.shared_examples "a base model" do |ransack_permitted_attributes: [], ransa
|
|
|
23
29
|
# end
|
|
24
30
|
let(:auth_object) { nil }
|
|
25
31
|
let(:policy) {
|
|
26
|
-
instance_double("BaseModelPolicy", policy_method =>
|
|
32
|
+
instance_double("BaseModelPolicy", policy_method => policy_output)
|
|
27
33
|
}
|
|
28
34
|
it "new user" do
|
|
29
35
|
expect(Pundit).to receive(:policy).with(an_instance_of(User),
|
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.10.
|
|
4
|
+
version: 0.10.2
|
|
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-
|
|
11
|
+
date: 2024-09-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|