inline_forms 8.1.13 → 8.1.15
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 +16 -0
- data/app/controllers/inline_forms_controller.rb +25 -0
- data/lib/inline_forms/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: 58e6670831f8bce627752b9797371fb20d2f3b14f571a4bc8c879478b71f5ff6
|
|
4
|
+
data.tar.gz: 32fd5f2f3503126e9113d10a3bea9ba23468667f11cc4db8252d78078b101af8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9e59af7820b05e5ef046c1771a85f37ee1d7dd4ab9affbe0f8e2dfda03fe49db57d9452972406a889f699732165b8117bb56ecdee6c6a5edf9c05b0d14642f8
|
|
7
|
+
data.tar.gz: 55be4d675321e511079de4a362688b664e65dce704dd56ef5929c8db2a286f0fef034312a2572016138808155a18e4f7150472a26aa904adb65e926d762da949
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ All notable changes to this project are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [8.1.15] - 2026-05-28
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **Post-delete undo on Apartment/Photo (and any model with `rich_text`) left `description` empty.** Undo only reified the parent row; ActionText bodies live in `action_text_rich_texts` and are removed on `destroy`, with separate PaperTrail `destroy` versions. `revert` now also reifies and saves each `ActionText::RichText` destroy snapshot that belonged to the restored parent (Apartment, nested Photo, `FormElementShowcase#description`, etc.).
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **Regression tests:** apartment row destroy+undo with `description` rich text; nested photo destroy+undo with `description` rich text.
|
|
16
|
+
|
|
17
|
+
## [8.1.14] - 2026-05-28
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **`example_app_showcase_row_turbo_test` broke `--example` installs.** The Empty-demo undo regression parsed the undo URL as `/revert/:id`, but member routes are `/form_element_showcases/:id/revert`. The installer gate failed (`131 runs, 1 failure`) and surfaced the misleading “Rails could not create the app 'MyApp', maybe because it is a reserved word…” message even though the app was generated. The test now matches the real path and loads the destroy version from PaperTrail.
|
|
22
|
+
|
|
7
23
|
## [8.1.13] - 2026-05-28
|
|
8
24
|
|
|
9
25
|
### Fixed
|
|
@@ -320,12 +320,37 @@ class InlineFormsController < ApplicationController
|
|
|
320
320
|
else
|
|
321
321
|
@parent = @object
|
|
322
322
|
@parent.save!
|
|
323
|
+
restore_rich_texts_for_reverted_parent!(@parent)
|
|
324
|
+
@parent.reload
|
|
323
325
|
end
|
|
324
326
|
render_revert_response if row_html_turbo_allowed?
|
|
325
327
|
end
|
|
326
328
|
|
|
327
329
|
private
|
|
328
330
|
|
|
331
|
+
# Undoing a parent +destroy+ reifies the Apartment/Photo row only. ActionText
|
|
332
|
+
# bodies live in +action_text_rich_texts+ and get their own PaperTrail
|
|
333
|
+
# +destroy+ versions; those rows are gone after +parent.destroy+, so we also
|
|
334
|
+
# reify and save each matching +ActionText::RichText+ destroy snapshot.
|
|
335
|
+
def restore_rich_texts_for_reverted_parent!(parent)
|
|
336
|
+
return unless defined?(ActionText::RichText)
|
|
337
|
+
|
|
338
|
+
record_type = parent.class.base_class.name
|
|
339
|
+
record_id = parent.id
|
|
340
|
+
|
|
341
|
+
PaperTrail::Version.where(item_type: "ActionText::RichText", event: "destroy").find_each do |version|
|
|
342
|
+
attrs = version.object_deserialized
|
|
343
|
+
next unless attrs.is_a?(Hash)
|
|
344
|
+
|
|
345
|
+
type = attrs["record_type"] || attrs[:record_type]
|
|
346
|
+
rid = attrs["record_id"] || attrs[:record_id]
|
|
347
|
+
next unless type == record_type && rid.to_i == record_id
|
|
348
|
+
|
|
349
|
+
rich_text = version.reify
|
|
350
|
+
rich_text&.save!
|
|
351
|
+
end
|
|
352
|
+
end
|
|
353
|
+
|
|
329
354
|
# +revert+ is excluded from +load_and_authorize_resource+; +authorize!+ runs in the
|
|
330
355
|
# action. +check_authorization+ on ApplicationController still requires that flag.
|
|
331
356
|
def revert_authorization_subject(version)
|
data/lib/inline_forms/version.rb
CHANGED