bard-attachment_field 0.5.4 → 0.5.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 +10 -0
- data/lib/bard/attachment_field/field.rb +8 -2
- data/lib/bard/attachment_field/version.rb +1 -1
- 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: 2733d25acbfd090219ca9d4b052dbb0de909d09ca6a40e6bd73a8cffc6592624
|
|
4
|
+
data.tar.gz: a7353e23c5320f82e53bbab05f5c0d2c4e671015006f6e44752a18bd51f6e1b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 733d951e0101860ee62df8cb677286a54d0f2de1fcde4ada547617c43a8d2b58e8ef8879ec998a317054b7b20e604b5027bc00dc15081feb4c73b10e2e0d4530
|
|
7
|
+
data.tar.gz: 1bcd82fcf146a89e3d16d827b2b3746e5ba5dc244d81777fede20ffa9882acb5ba6a49e5d19e45678c63837365cf04bbee671b1b68fbd8f40ea6be0575ec1e8c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.5] - 2026-06-06
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
- Capture the block passed to `attachment_field` instead of using its return
|
|
8
|
+
value. Previously the block's markup leaked to the surrounding output buffer,
|
|
9
|
+
leaving `<input-attachment>` with no `<attachment-file>` child — so editing a
|
|
10
|
+
record and saving without touching the file submitted an empty value and
|
|
11
|
+
silently purged the existing attachment.
|
|
12
|
+
|
|
3
13
|
## [0.2.0] - 2026-03-03
|
|
4
14
|
|
|
5
15
|
### Features
|
|
@@ -8,8 +8,12 @@ module Bard
|
|
|
8
8
|
})
|
|
9
9
|
add_default_name_and_id(options)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
content = if block
|
|
12
|
+
# Capture the template block's rendered markup. Using block.call would
|
|
13
|
+
# return the block's value while its markup leaked to the surrounding
|
|
14
|
+
# output buffer, leaving <input-attachment> childless (see BARD #262849).
|
|
15
|
+
@template_object.capture(options, &block)
|
|
16
|
+
else
|
|
13
17
|
Array(object.try(@method_name)).map do |attachment|
|
|
14
18
|
content_tag("attachment-file", nil, {
|
|
15
19
|
name: options["name"],
|
|
@@ -20,6 +24,8 @@ module Bard
|
|
|
20
24
|
})
|
|
21
25
|
end.join("\n").html_safe
|
|
22
26
|
end
|
|
27
|
+
|
|
28
|
+
content_tag("input-attachment", content, options)
|
|
23
29
|
end
|
|
24
30
|
|
|
25
31
|
private
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bard-attachment_field
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Micah Geisel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-06-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activestorage
|