shale-builder 0.8.2 → 0.8.4
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 +14 -0
- data/Gemfile.lock +1 -1
- data/lib/shale/builder/nested_validations.rb +9 -6
- data/lib/shale/builder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9599ec92d021b9ed5b62272efaabaca3a77944c4a8c9611f8ad6fbee730d6e9d
|
|
4
|
+
data.tar.gz: e8c0dfab2765c8e328fe29916f80e751748c27eb293ff8d3db7c927deb89f901
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4fee3d4b8016d6e3d334101f4fd0a4c1f7b712271603ab0ff586e5d0697eabf7ec905387efde342345f44eff5e3ef6c43e7f2e467404a6ba10b21728c9c66ff2
|
|
7
|
+
data.tar.gz: 62c613bfa8e6f0803e96995b628633a4a085b78d061c5573bd44a41ef648aae6eaf3330fe8d27b5c99098ad816260b5a3afa4dbc554c32dc2ed975714948c2cf
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.8.3] - 2025-10-24
|
|
9
|
+
|
|
10
|
+
[Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.8.2...v0.8.3)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
- Make `name` in `Shale::Builder::NestedValidations#import_errors` an optional kwarg
|
|
14
|
+
|
|
15
|
+
## [0.8.3] - 2025-10-24
|
|
16
|
+
|
|
17
|
+
[Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.8.2...v0.8.3)
|
|
18
|
+
|
|
19
|
+
### Changes
|
|
20
|
+
- Fix `valid?`
|
|
21
|
+
|
|
8
22
|
## [0.8.2] - 2025-10-24
|
|
9
23
|
|
|
10
24
|
[Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.8.1...v0.8.2)
|
data/Gemfile.lock
CHANGED
|
@@ -59,7 +59,7 @@ module Shale
|
|
|
59
59
|
def valid?
|
|
60
60
|
result = super
|
|
61
61
|
|
|
62
|
-
validatable_attribute_names.
|
|
62
|
+
validatable_attribute_names.each do |name|
|
|
63
63
|
next unless name
|
|
64
64
|
|
|
65
65
|
val = public_send(name)
|
|
@@ -67,20 +67,23 @@ module Shale
|
|
|
67
67
|
next if val.valid?
|
|
68
68
|
|
|
69
69
|
result = false
|
|
70
|
-
import_errors(val)
|
|
70
|
+
import_errors(val, name: name)
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
result
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
#: (ActiveModel::Validations?) -> void
|
|
77
|
-
def import_errors(obj)
|
|
76
|
+
#: (ActiveModel::Validations?, ?name: String | Symbol?) -> void
|
|
77
|
+
def import_errors(obj, name: nil)
|
|
78
78
|
return unless obj
|
|
79
79
|
|
|
80
80
|
errlist = errors
|
|
81
|
-
|
|
81
|
+
if name
|
|
82
|
+
separator = nested_attr_name_separator
|
|
83
|
+
prefix = "#{name}#{separator}"
|
|
84
|
+
end
|
|
82
85
|
obj.errors.each do |err|
|
|
83
|
-
errlist.import(err, attribute: "#{
|
|
86
|
+
errlist.import(err, attribute: "#{prefix}#{err.attribute}")
|
|
84
87
|
end
|
|
85
88
|
end
|
|
86
89
|
|