inline_forms 7.9.1 → 7.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cce3cdf65d2a40a3481fba51c95e57bfa6a65cd4a73359ad974fc327252dd7a
4
- data.tar.gz: 7f57a6489ef1d88328474330fe70492f1266e5e394163260b2cc773c414571b8
3
+ metadata.gz: 281044e95bf57057e431eb66dfc19879e88b0a6f4f61d0d76c5a5d379d0e513c
4
+ data.tar.gz: 3367579c48e40f3a23d3a5239629161f3a1f9fc1c03bd56ae933d529d56d35e2
5
5
  SHA512:
6
- metadata.gz: fb6275f4b67706bee0e3b263e3b54b5a5a8be8a7f20676fd0ea0504be0e98edc3e3f41c98a807f1f28cdc4f5367e9a0f9a8c895bfa052978483f09148e1904e7
7
- data.tar.gz: f168431ca3b73f07cfd2190b21ba211be91ab529861751d588ff33ed2e832e985411ec414ae2c5f958a9dd867e84083b5841e79424d2662bc558f35c10caac15
6
+ metadata.gz: a6a918d3a65bd249450449987601216d1c04b36fe1989ffde02356bbfa9f3700fb4d0f305ef46fab95dc2a8097fe84ec9cdc9d96f8e51513de356556f300130c
7
+ data.tar.gz: 47d4a9c1dd290fb4eca21b57282ef819468358b3dcd783eb2c3c89e5001b93032e8e2be0537384de4c18c1dcdadb917a810a5389362794592956844624510f4d
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
+ ## [7.9.3] - 2026-05-17
8
+
9
+ ### Fixed
10
+
11
+ - **Nested Photo versions frame id:** `inline_forms_versions_turbo_frame_id` returns `apartment_<aid>_photo_<pid>_versions` for `not_accessible_through_html?` children. `render_revert_turbo_streams` and versions partials now use it so image revert turbo-stream replaces the correct frame (fixes `ExampleAppPhotoRevertTest`).
12
+
13
+ ## [7.9.2] - 2026-05-17
14
+
15
+ ### Changed
16
+
17
+ - **`validation_hints` dependency** bumped to `>= 6.0`, `< 7.0`; the `--example` installer Gemfile pins `~> 6.2`.
18
+
19
+ ### Fixed
20
+
21
+ - **`validation_hints` load order:** engine initializer applies `ValidationHints::ValidationsPatch` because apps `require "rails/all"` before `Bundler.require`, so the gem's `on_load(:active_model)` hook never runs.
22
+
7
23
  ## [7.9.1] - 2026-05-17
8
24
 
9
25
  ### Added
@@ -306,7 +306,7 @@ class InlineFormsController < ApplicationController
306
306
  # replaces both the row and the versions panel in one response.
307
307
  def render_revert_turbo_streams
308
308
  row_id = helpers.inline_forms_row_turbo_frame_id(@parent)
309
- versions_id = "#{@parent.class.name.underscore}_#{@parent.id}_versions"
309
+ versions_id = helpers.inline_forms_versions_turbo_frame_id(@parent)
310
310
  row_html = render_to_string(
311
311
  "inline_forms/row_close",
312
312
  layout: false,
@@ -83,6 +83,13 @@ module InlineFormsHelper
83
83
  "#{parent.class.name.underscore}_#{parent.id}_#{object.class.name.underscore}_#{object.id}"
84
84
  end
85
85
 
86
+ # +<turbo-frame>+ id for the versions panel on a row (+…_versions+).
87
+ # Nested +not_accessible_through_html?+ children use the row prefix
88
+ # (+apartment_5_photo_2_versions+), not bare +photo_2_versions+.
89
+ def inline_forms_versions_turbo_frame_id(object)
90
+ "#{inline_forms_row_turbo_frame_id(object)}_versions"
91
+ end
92
+
86
93
  private
87
94
 
88
95
  def validation_hints_as_list_for(object, attribute)
@@ -92,7 +92,7 @@
92
92
  <% end %>
93
93
  <% end %>
94
94
  <% if can? :list_versions, @object %>
95
- <% css_class_id = "#{@object.class.name.underscore}_#{@object.id}_versions" -%>
95
+ <% css_class_id = inline_forms_versions_turbo_frame_id(@object) -%>
96
96
  <turbo-frame id="<%= css_class_id -%>">
97
97
  <%= render "versions" %>
98
98
  </turbo-frame>
@@ -1,5 +1,5 @@
1
1
  <% object = local_assigns[:object] || @object -%>
2
- <% css_class_id = "#{object.class.name.underscore}_#{object.id}_versions" -%>
2
+ <% css_class_id = inline_forms_versions_turbo_frame_id(object) -%>
3
3
  <div class="row form_element_header associated_auto_header callout">
4
4
  <div class='medium-11 large-11 column' >
5
5
  <%= "Versions (#{object.versions.length})" %>
@@ -1,5 +1,5 @@
1
1
  <% path_to_object = @object.class.to_s.underscore + '_path' %>
2
- <% css_class_id = "#{@object.class.name.underscore}_#{@object.id}_versions" -%>
2
+ <% css_class_id = inline_forms_versions_turbo_frame_id(@object) -%>
3
3
  <% entries = inline_forms_versions_for(@object) -%>
4
4
  <div class="row form_element_header associated_auto_header callout">
5
5
  <div class='medium-11 large-11 column' >
@@ -71,7 +71,7 @@ gem 'importmap-rails'
71
71
  gem 'turbo-rails'
72
72
  gem 'tabs_on_rails', :git => 'https://github.com/acesuares/tabs_on_rails.git', :branch => 'update_remote_before_action'
73
73
  gem 'unicorn'
74
- gem 'validation_hints'
74
+ gem 'validation_hints', '~> 6.2'
75
75
  gem 'will_paginate' #, git: 'https://github.com/acesuares/will_paginate.git'
76
76
 
77
77
  gem_group :test do
data/inline_forms.gemspec CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
33
33
 
34
34
  s.add_dependency('rvm', '>= 1.11', '< 2.0')
35
35
  s.add_dependency('thor', '>= 1.0', '< 2.0')
36
- s.add_dependency('validation_hints', '>= 0.2', '< 1.0')
36
+ s.add_dependency('validation_hints', '>= 6.0', '< 7.0')
37
37
  s.add_dependency('rails', '>= 7.0.0', '< 7.1')
38
38
  s.add_dependency('rails-i18n', '>= 7.0', '< 8.0')
39
39
 
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineForms
3
- VERSION = "7.9.1"
3
+ VERSION = "7.9.3"
4
4
  end
data/lib/inline_forms.rb CHANGED
@@ -181,6 +181,13 @@ module InlineForms
181
181
  # Declare as a Rails::Engine, see http://www.ruby-forum.com/topic/211017#927932
182
182
  class Engine < Rails::Engine
183
183
 
184
+ # validation_hints 6.x registers its ActiveModel patch via on_load, but apps
185
+ # require rails/all before Bundler.require, so active_model is already loaded.
186
+ initializer "inline_forms.validation_hints" do
187
+ require "validation_hints"
188
+ ValidationHints::ValidationsPatch.apply!
189
+ end
190
+
184
191
  initializer "inline_forms.assets.precompile" do |app|
185
192
  app.config.assets.precompile += %w(
186
193
  inline_forms/inline_forms.css
@@ -225,7 +225,7 @@ class ExampleAppApartmentPhotosPaginationTest < ExampleAppIntegrationTestCase
225
225
  original_name = photo.name
226
226
  photo.update!(name: "#{original_name}-changed")
227
227
  row_id = "apartment_#{@apartment.id}_photo_#{photo.id}"
228
- versions_frame = "photo_#{photo.id}_versions"
228
+ versions_frame = "#{row_id}_versions"
229
229
  version = photo.versions.where(event: "update").order(:id).last
230
230
  assert version, "expected an update version to revert"
231
231
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.9.1
4
+ version: 7.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares
@@ -57,20 +57,20 @@ dependencies:
57
57
  requirements:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: '0.2'
60
+ version: '6.0'
61
61
  - - "<"
62
62
  - !ruby/object:Gem::Version
63
- version: '1.0'
63
+ version: '7.0'
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: '0.2'
70
+ version: '6.0'
71
71
  - - "<"
72
72
  - !ruby/object:Gem::Version
73
- version: '1.0'
73
+ version: '7.0'
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: rails
76
76
  requirement: !ruby/object:Gem::Requirement