inline_forms_installer 8.1.15 → 8.1.16

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: d5f4f62e8dc739c6bcde28ecb37ec09d51d96fb26083bdf7d6f5b2e0728fe118
4
- data.tar.gz: 577d7275a99ed7089d373a87da0e271c24c2910054f81350f0777296a99860c4
3
+ metadata.gz: 6239acf08fdfdd6a13a2bdc0cdb64d09175dc76e12297aefb854efe97b1c7210
4
+ data.tar.gz: 0ec799f3e8bb895459b2e581074b782757dc05806187e38d098fccf2c95d7f87
5
5
  SHA512:
6
- metadata.gz: 91383e851c360f5e93ee24175c6b8f9f7bc5eb4ca9163ab167335a1c803ed054c8daa8c723e7576b586e4a03f3250411b6cc4321446ca48d0b034e8ad2d50128
7
- data.tar.gz: 479e0d53b0c2531a32c943cb7c8e5350ec8b0611c3281b6bd3147b94760e3d2eaa6df6bfc6b3c649a844bf8235f682af136688091fb954b0b4c8bab3fc0663cf
6
+ metadata.gz: 469c80a9b337acb714b5b80cb1b07437689893c5cc102acf68277c98484cec8edcbe812a7f51225565334e127e07090b1f3ff30de4777a94f87dba53953e4b5e
7
+ data.tar.gz: bd20ad4a92974a8da353c29f5bd065d2e03e82e344034d3e97ac2c8575dee5038b17131655310de0768356015454e0ccf42f12425dc90343c3ca2425f164a7e0
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineFormsInstaller
3
- VERSION = "8.1.15"
3
+ VERSION = "8.1.16"
4
4
 
5
5
  # Written into generated apps' `.ruby-version` (must match gemspec `required_ruby_version`).
6
6
  TARGET_RUBY_VERSION = "ruby-4.0.4"
@@ -53,4 +53,44 @@ class ExampleAppPhotosTest < ExampleAppIntegrationTestCase
53
53
  assert_response :success
54
54
  assert_includes Photo.find(photo_id).description.body.to_html, "survives undo"
55
55
  end
56
+
57
+ test "nested photo delete undo twice does not duplicate ActionText rows" do
58
+ photo = @apartment.photos.create!(name: "twice.jpg", caption: "c")
59
+ body = "<p>Twice undo description</p>"
60
+ field_frame = "apartment_#{@apartment.id}_photo_#{photo.id}_description"
61
+ put photo_path(
62
+ photo,
63
+ attribute: "description",
64
+ form_element: "rich_text",
65
+ update: field_frame
66
+ ), params: { description: body },
67
+ headers: { "Turbo-Frame" => field_frame, "Accept" => "text/html" }
68
+
69
+ photo_id = photo.id
70
+ row_frame = "apartment_#{@apartment.id}_photo_#{photo_id}"
71
+ row_headers = { "Turbo-Frame" => row_frame, "Accept" => "text/html" }
72
+ stream_headers = row_headers.merge("Accept" => "text/vnd.turbo-stream.html")
73
+
74
+ 2.times do
75
+ delete photo_path(Photo.find(photo_id), update: row_frame), headers: row_headers
76
+ assert_response :success
77
+
78
+ destroy_version = PaperTrail::Version.where(
79
+ item_type: "Photo",
80
+ item_id: photo_id,
81
+ event: "destroy"
82
+ ).order(:id).last
83
+ post revert_photo_path(destroy_version, update: row_frame), headers: stream_headers
84
+ assert_response :success,
85
+ "second delete/undo must not INSERT a duplicate action_text_rich_texts id"
86
+ end
87
+
88
+ assert_equal 1,
89
+ ActionText::RichText.where(
90
+ record_type: "Photo",
91
+ record_id: photo_id,
92
+ name: "description"
93
+ ).count
94
+ assert_includes Photo.find(photo_id).description.body.to_html, "Twice undo"
95
+ end
56
96
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms_installer
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.15
4
+ version: 8.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares