guide-rail 0.2.4 → 0.2.5
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 +4 -0
- data/README.md +2 -0
- data/lib/guide_rail/factory.rb +4 -1
- data/lib/guide_rail/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: 68342bb92a1b43e2cfbbb015595332832d105e98fe86a05b57ffd084339d0940
|
|
4
|
+
data.tar.gz: 37736378ff24a0bef3dfe79ffb0c63a7d7ed86272da7306a60eefc76c78db6a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 35fe93962c60b50699ef50678d0b156ade74e7a3fbeb2aac7ef760828790a7ab1e509409f63a9ab9ce7da0707ac9d8772f5a6010f9530d45aadd7431fd763aac
|
|
7
|
+
data.tar.gz: 7c3d653488dd0ed9f28ad689a71d65c55af3b9d902b0d5c0e11c2c69416516b280ff3ead4360146f49e85adc58cb4e35215a822bfd90013fa7a5cff891832e34
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## [0.2.5] - 2026-11-22
|
|
2
|
+
|
|
3
|
+
- Fix `renderable` with `computed` overwriting a nested schema attr. When the computed returns `nil`, the default of the schema shape ( e.g. `{lat: "", lon: ""}` ) is set instead of `""`
|
|
4
|
+
|
|
1
5
|
## [0.2.4] - 2026-11-22
|
|
2
6
|
|
|
3
7
|
- Fix syntax and arguments of `sig/guide-rail.rbs`. It could not be parsed by rbs since 0.1.0
|
data/README.md
CHANGED
data/lib/guide_rail/factory.rb
CHANGED
|
@@ -76,7 +76,7 @@ class GuideRail::Factory
|
|
|
76
76
|
if result.success?
|
|
77
77
|
values = schema_values(result)
|
|
78
78
|
values.merge!(compute(values))
|
|
79
|
-
values = to_renderable(values,
|
|
79
|
+
values = to_renderable(values, computed_shallow_renderable_default.merge(renderable_default)) if @_renderable
|
|
80
80
|
|
|
81
81
|
new_value = Object.const_get(@_class_name).new(*values.values_at(*all_member_names).map(&:freeze))
|
|
82
82
|
|
|
@@ -130,6 +130,9 @@ class GuideRail::Factory
|
|
|
130
130
|
@_computeds.transform_values { |block| block.call(acc).freeze }
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
+
#
|
|
134
|
+
# Computed attrs have no shape, so the default is "". For a computed attr
|
|
135
|
+
# overwriting a schema attr, the default of the schema shape takes precedence.
|
|
133
136
|
#
|
|
134
137
|
# @return [Hash]
|
|
135
138
|
#
|
data/lib/guide_rail/version.rb
CHANGED