formatic 0.3.0 → 0.4.0
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/app/components/formatic/file.rb +19 -0
- data/lib/formatic/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: 2e8931dc635b9f82d078e614fe974173add25c068d5269c28531fe947c3be596
|
|
4
|
+
data.tar.gz: e73abb6b3045ca45d0546a17967e60f6aec03489a48381240447a3e0a3d63bc4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4e0ec1a1dc71da29321efee225c7a3ca3aa4dc4fd15bd885ff8d80a0e903cd62879ddd5078d742e9ca9a66a2efb1517db0b3855dc8ef2ac843fa51d145abe81
|
|
7
|
+
data.tar.gz: 6bd89feb80068a835b453ef11af4df9635f3094347f090c45f3e21b3029f7f3b44dbe52b1ceebbf403a664d5b8f942d86f1f09493eabaf129f1d1b55f053a048
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## [0.4.0] 2026-08-05
|
|
2
|
+
|
|
3
|
+
- `Formatic::File` now raises at render time when `attribute_name` does not exist on the model, so typos like `header_logo_for_light` (instead of the model's `header_logo_for_dark`) surface immediately instead of silently dropping the upload. The check is skipped when a manual `value:` is passed, the form builder has no object, or the object is not an ActiveModel/ActiveRecord record.
|
|
4
|
+
|
|
1
5
|
## [0.3.0] 2026-08-04
|
|
2
6
|
|
|
3
7
|
- Make VS Code snippet symlinking atomic so concurrent app boots no longer race into `Errno::EEXIST`
|
|
@@ -42,8 +42,27 @@ module Formatic
|
|
|
42
42
|
{ entries: entries_json }.merge(manual_data)
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
def before_render
|
|
46
|
+
validate_attribute_name!
|
|
47
|
+
end
|
|
48
|
+
|
|
45
49
|
private
|
|
46
50
|
|
|
51
|
+
def validate_attribute_name!
|
|
52
|
+
# A manually passed value means `attribute_name` is just a param name,
|
|
53
|
+
# not necessarily a method on the model.
|
|
54
|
+
return if manual_value != :_fetch_from_record
|
|
55
|
+
return if f.nil? || f.object.nil?
|
|
56
|
+
|
|
57
|
+
# Only enforce this for real ActiveModel/ActiveRecord records.
|
|
58
|
+
# Custom objects (e.g. slugs) are not expected to respond to it.
|
|
59
|
+
return unless f.object.respond_to?(:model_name)
|
|
60
|
+
return if f.object.respond_to?(attribute_name)
|
|
61
|
+
|
|
62
|
+
raise ArgumentError,
|
|
63
|
+
"attribute `#{attribute_name}` does not exist on #{f.object.class}."
|
|
64
|
+
end
|
|
65
|
+
|
|
47
66
|
def attachments
|
|
48
67
|
return [] if value.blank?
|
|
49
68
|
|
data/lib/formatic/version.rb
CHANGED