inline_forms 7.13.2 → 7.13.3
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 +24 -0
- data/app/views/inline_forms/_versions_list.html.erb +11 -1
- data/lib/generators/templates/model.erb +8 -1
- 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: ec05aa4e1a1a1f21dcd041e8022943ec84af7c9b1ad4ccd90a6f57721f1732cd
|
|
4
|
+
data.tar.gz: 05fac9919e1730afa9797d2b343a0c76484cf28c6ac0ca210daed96312699902
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 927830ff6c84fa2642f243df6956725584b990814ffc10a357983b253117cb2c1c99f3dc7b304438becd1a20e962cae72df6714f4b570cac4c1a54fe65dc3134
|
|
7
|
+
data.tar.gz: ad534d4e02d38e4dc6d607e18a92725cda21334a73b5a41bbea096dd5bb830fc23697a58928345ac32426fe5c3939a46106fb176068e1aa696637f2a7e7dcd6b
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,30 @@ All notable changes to this project are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [7.13.3] - 2026-05-19
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **Versions panel — "empty" `update` row whose Restore link did nothing.** Creating a record with a `rich_text` field (e.g. a new Photo with a `description`) produced a parent-side PaperTrail `update` version with `changeset == {}`. Cause: PaperTrail 16 tracks `:touch` by default (`on: [:create, :update, :destroy, :touch]`), and ActionText's `belongs_to :record, polymorphic: true, touch: true` calls `parent.touch` on every rich-text save. The resulting version reified to the same state, so clicking Restore was a visible no-op.
|
|
12
|
+
- **`lib/generators/templates/model.erb`**: emit `has_paper_trail on: [:create, :update, :destroy]` (drop `:touch`). New `rails g inline_forms …` models no longer create these noise versions. Existing apps need to re-apply the change to their models.
|
|
13
|
+
- **`lib/inline_forms_installer/installer_core.rb`** (`config/initializers/rich_text_paper_trail.rb`): mirror the opt-out on `ActionText::RichText` for symmetry against any future `touch: true` association pointing at rich-text rows.
|
|
14
|
+
- **`app/views/inline_forms/_versions_list.html.erb`**: defensive view-side gate — hide the Restore link when `version.changeset` is `nil` or empty after dropping `updated_at`. Covers legacy apps that still track `:touch`, plus any other empty-update source (e.g. CarrierWave callbacks that don't change attributes). The row stays visible in the audit trail; only the dead Restore link is suppressed.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **`test/integration/example_app_apartment_versions_turbo_test.rb`** (installer template):
|
|
19
|
+
- `creating a record with a rich_text body does not append a touch-only parent update` — pins the generator-template change.
|
|
20
|
+
- `versions list hides Restore link on empty-changeset update rows` — pins the view-side guard against legacy `:touch` tracking.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **`InlineForms::VERSION`** and **`InlineFormsInstaller::VERSION`** → `7.13.3` (installer's `INLINE_FORMS_VERSION = VERSION` writes the `gem "inline_forms", "~> X.Y.Z"` pin into generated `Gemfile`s).
|
|
25
|
+
|
|
26
|
+
### Verified
|
|
27
|
+
|
|
28
|
+
- `gem build inline_forms.gemspec` → `inline_forms-7.13.3.gem`; `gem build inline_forms_installer.gemspec` → `inline_forms_installer-7.13.3.gem`.
|
|
29
|
+
- `inline_forms create MyApp -d sqlite --example` → `bundle exec rails test` — **81 runs, 0 failures, 0 errors, 0 skips** (Ruby 4.0.4 / Rails 7.2.3.1).
|
|
30
|
+
|
|
7
31
|
## [7.13.2] - 2026-05-19
|
|
8
32
|
|
|
9
33
|
### Fixed
|
|
@@ -55,9 +55,19 @@
|
|
|
55
55
|
the record — primary records already have a dedicated Destroy
|
|
56
56
|
button (superadmin), and rich_text content can be cleared by
|
|
57
57
|
editing. Omitting the link here keeps the UI consistent and
|
|
58
|
-
avoids a NoMethodError in the controller's `save!`.
|
|
58
|
+
avoids a NoMethodError in the controller's `save!`.
|
|
59
|
+
|
|
60
|
+
Empty-changeset update rows (e.g. PaperTrail `touch` events from
|
|
61
|
+
`belongs_to ..., touch: true` on associated ActionText::RichText
|
|
62
|
+
or CarrierWave callbacks) reify the same state — Restore on them
|
|
63
|
+
is a visible no-op. New generated models opt out of touch
|
|
64
|
+
tracking (`has_paper_trail on: [:create, :update, :destroy]`),
|
|
65
|
+
but legacy apps still have these rows in the audit trail; the
|
|
66
|
+
link is hidden here so the action is never offered. -%>
|
|
59
67
|
<% if version.event == "create" %>
|
|
60
68
|
|
|
69
|
+
<% elsif version.changeset.nil? || version.changeset.except("updated_at").empty? %>
|
|
70
|
+
|
|
61
71
|
<% else %>
|
|
62
72
|
<% row_id = inline_forms_row_turbo_frame_id(@object) %>
|
|
63
73
|
<%= link_to t("inline_forms.view.restore"),
|
|
@@ -2,7 +2,14 @@ class <%= name %> < ApplicationRecord
|
|
|
2
2
|
attr_reader :per_page
|
|
3
3
|
@per_page = 7
|
|
4
4
|
attr_writer :inline_forms_attribute_list
|
|
5
|
-
|
|
5
|
+
# PaperTrail 16 defaults to `on: [:create, :update, :destroy, :touch]`.
|
|
6
|
+
# ActionText's `belongs_to :record, polymorphic: true, touch: true` (set by
|
|
7
|
+
# `has_rich_text`) calls `parent.touch` on every rich-text save, which
|
|
8
|
+
# produced a parent-side `update` version with an empty changeset — visible
|
|
9
|
+
# in the inline_forms versions panel as a meaningless "empty" row whose
|
|
10
|
+
# Restore link reifies the same state (no-op). Excluding `:touch` here
|
|
11
|
+
# suppresses that noise without affecting real attribute updates.
|
|
12
|
+
has_paper_trail on: [:create, :update, :destroy]
|
|
6
13
|
<%= @carrierwave_mounters if @carrierwave_mounters.length > 1 -%>
|
|
7
14
|
<%= @belongs_to if @belongs_to.length > 1 -%>
|
|
8
15
|
<%= @has_many if @has_many.length > 1 -%>
|
data/lib/inline_forms/version.rb
CHANGED