inline_forms 8.0.2 → 8.0.4

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: 7678c685b9cc14f088b696037a582cc0214072597f29b66704ffb40b47ddece5
4
- data.tar.gz: ae6e2d7efd33d4223c352c86d541d39be967a8fea67fa2bbf7e6fce353870bcb
3
+ metadata.gz: 83fc3ebab88e414806da9e2c7f9a47088eb1d69579f607af783e647f374ada2b
4
+ data.tar.gz: 76348168e6d35fb88a7142e66e92938ae6938b83cd606a894f1985c37c7cd219
5
5
  SHA512:
6
- metadata.gz: c17abcf5d7d4d7c482ebce2f5ce0e65ee96ce99022dc6099a42002425bf9fb3dffc52eabb0a88b7ed41c243a3ddbd38d5bdae41b34edd63509a294c2ea1d7860
7
- data.tar.gz: 7921ace1de20cad8132c7d62fc815c8de8bcc598b3a3634de4f291b4f01cae5714d44b7f69669906f80d32a0e9235aad9220e56e366bdccd60da8cf867e8469f
6
+ metadata.gz: d3d2b9b5a2cc0239857123cf16cd6605f58d27e324accddb8232015445767e3b06214c4c869d6089218b42aa72f737a11611d83abc3b53e731573ea628987944
7
+ data.tar.gz: 29d10dd86bb1c3bff98a5653b513de213e08250ab43b3fd3969e1aeaa71cd690f73f9034f51c64e775debeff69abd6180b5895867e7c4ca0a9aa10bda879fe07
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
+ ## [8.0.4] - 2026-05-24
8
+
9
+ ### Added
10
+
11
+ - **`inline_forms create --user-model` (`-U`):** choose the Devise-backed model class (e.g. `Member`). Default remains `User`. Non-default models use `devise_for :users, class_name: "…", path: "…"` so Warden scope stays `:user` (`current_user`, `destroy_user_session_path`, etc.). Installer generates matching table, routes, controller, Locale/Role associations, HABTM join table (`members_roles`, etc.), seeds, Ability guest user, and `--example` test substitutions.
12
+
13
+ ### Changed
14
+
15
+ - **`version_modified_by`:** resolves the auth model via `Devise.mappings[:users]` instead of hard-coding `User` (PaperTrail “modified by” on custom auth models).
16
+
17
+ ## [8.0.3] - 2026-05-22
18
+
19
+ ### Added
20
+
21
+ - **Rails 8 release docs (Phase 5):** [`docs/rails-8-release.md`](docs/rails-8-release.md) (gate results, stack table); [`docs/zeitwerk-and-load-paths.md`](docs/zeitwerk-and-load-paths.md) (intentional ignores vs autoloaded paths).
22
+ - **Example app gate (recorded):** `inline_forms create MyApp -d sqlite --example` → **88 runs, 502 assertions, 0 failures**; `rails zeitwerk:check` → clean.
23
+
24
+ ### Changed
25
+
26
+ - **Rails 8 (Phase 4):** framework-defaults audit documented in [`docs/rails-8-phase4-audit.md`](docs/rails-8-phase4-audit.md); generated apps stay on `load_defaults 8.0` only (no `new_framework_defaults_8_0.rb`, matching `rails new` 8.0.5).
27
+ - **Unicorn template:** `before_fork` uses `ActiveRecord::Base.connection_pool.disconnect!` (Rails 8–compatible).
28
+ - **README.rdoc:** requirements table for Ruby 4 / Rails 8 / validation_hints 8; remove stale “broken after 6.2.14” notice; `rails-i18n ~> 8.0` narrative.
29
+ - **`inline_forms.gemspec`:** summary/description updated for Rails 8 (remove stale “broken after 6.2.14” text).
30
+
7
31
  ## [8.0.2] - 2026-05-22
8
32
 
9
33
  ### Changed
data/README.rdoc CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Inline Forms is almost a complete admin application. You can try it out easily.
4
4
 
5
- = Release status notice
5
+ = Requirements
6
6
 
7
- All gem versions after +6.2.14+ are currently broken.
8
-
9
- We will post a notice when the gem is good again.
7
+ * Ruby **>= 4.0** (generated apps pin **ruby-4.0.4**)
8
+ * Rails **8.0.x** (+rails ~> 8.0+, +config.load_defaults 8.0+)
9
+ * **validation_hints** **~> 8** (companion gem; same version line as +inline_forms+ / +inline_forms_installer+)
10
10
 
11
11
  = Usage
12
12
 
@@ -14,7 +14,7 @@ The +inline_forms create+ CLI ships in the +inline_forms_installer+ gem (not in
14
14
 
15
15
  gem install inline_forms_installer
16
16
 
17
- Generated apps pin +inline_forms+ and +validation_hints+ at +~> 7+ (Bundler picks the latest 7.x). The three gems (+inline_forms+, +inline_forms_installer+, +validation_hints+) are released together with the same version number; use a current +inline_forms_installer+ so the installer template matches current Rails pins. To add the engine to an existing Rails app without the CLI:
17
+ Generated apps pin +inline_forms+ and +validation_hints+ at +~> 8+ (Bundler picks the latest 8.x). The three gems (+inline_forms+, +inline_forms_installer+, +validation_hints+) are released together with the same version number; use a current +inline_forms_installer+ so the installer template matches current Rails pins. To add the engine to an existing Rails app without the CLI:
18
18
 
19
19
  gem install inline_forms inline_forms_installer
20
20
 
@@ -30,6 +30,12 @@ If you want to install the example application:
30
30
 
31
31
  inline_forms create MyApp -d sqlite --example
32
32
 
33
+ To use a different Devise model (e.g. +Member+ on a +members+ table) while keeping Warden scope +:user+ so +current_user+ works in inline_forms:
34
+
35
+ inline_forms create MyApp -d sqlite --example --user-model Member
36
+
37
+ The installer emits +devise_for :users, class_name: "Member", path: "members"+ (sign-in at +/auth/members/sign_in+), +resources :members+, and the usual +authenticate_user!+ / +destroy_user_session_path+ helpers.
38
+
33
39
  Then point your browser to http://localhost:3000/apartments and log in with admin@example.com / admin999. The example also adds integration and model tests; run +bundle exec rails test+ in +MyApp+, then start the server with +bundle exec rails s+ when you want the UI.
34
40
 
35
41
  The example app now ships three models:
@@ -246,7 +252,7 @@ In every case the Turbo wiring is the same: +link_options: { data: { turbo_frame
246
252
 
247
253
  == Generated application +rails-i18n+
248
254
 
249
- New apps get +rails-i18n+ from RubyGems (+ '~> 7.0'+), not from the +svenfuchs/rails-i18n+ Git repository. Release line 7.0.x declares +railties+ between 6 and 8, which matches the installer template’s pinned +rails ~> 7.2.3+ (with +config.load_defaults 7.2+). The upstream repository’s default branch is aimed at newer Rails and would pull in +railties+ 8+, which cannot be resolved together with that pin.
255
+ New apps get +rails-i18n+ from RubyGems (+ '~> 8.0'+), not from the +svenfuchs/rails-i18n+ Git repository. The installer pins +rails ~> 8.0+ with +config.load_defaults 8.0+; the published +rails-i18n+ 8.x line matches that stack.
250
256
 
251
257
  == File uploads (CarrierWave)
252
258
 
@@ -347,9 +347,14 @@ module InlineFormsHelper
347
347
  values
348
348
  end
349
349
 
350
- def version_modified_by id
351
- user = User.find_by_id id
352
- user.nil? ? 'Unknown' : user.name
350
+ def version_modified_by(id)
351
+ return "Unknown" if id.blank?
352
+
353
+ user_class = Devise.mappings[:users]&.to
354
+ return "Unknown" unless user_class
355
+
356
+ user = user_class.find_by(id: id)
357
+ user.nil? ? "Unknown" : user.name
353
358
  end
354
359
 
355
360
  end
@@ -0,0 +1,39 @@
1
+ # Rails 8 — Phase 4 audit (framework defaults & cleanup)
2
+
3
+ **Date:** 2026-05-22
4
+ **Scope:** Post–Phase 3 (`inline_forms` 8.0.2 installer + example app gate).
5
+
6
+ ## 4.1 Framework defaults (`rails new` 8.0.5)
7
+
8
+ Vanilla `rails _8.0.5_ new` (importmap, `--skip-bundle`):
9
+
10
+ - `config/application.rb`: `config.load_defaults 8.0`, `config.autoload_lib(ignore: %w[assets tasks])`
11
+ - Generator **removes** `config/initializers/new_framework_defaults_8_0.rb` (opt-in flags live only in the railties template until uncommented)
12
+ - Optional 8.0 toggles (all commented in upstream template): `active_support.to_time_preserves_timezone`, `action_dispatch.strict_freshness`, `Regexp.timeout`
13
+
14
+ **Installer decision:** Match vanilla Rails 8 — rely on `load_defaults 8.0` only; do **not** ship `new_framework_defaults_8_0.rb` in generated apps. Keep a belt-and-suspenders `gsub` to `load_defaults 8.0` if an older `rails new` left another minor.
15
+
16
+ ## 4.2 Rails 8 API / deprecation grep
17
+
18
+ | Area | Result |
19
+ |------|--------|
20
+ | `form_with` / `model: nil` | No engine usage; inline fields use custom helpers / Turbo, not `form_with` |
21
+ | `form_for` | Devise templates only (upstream Devise 5) |
22
+ | `ActiveRecord::Base.connection` | Unicorn `before_fork` template updated → `connection_pool.disconnect!` |
23
+ | `ActionController` deprecated flags | None in `lib/` |
24
+ | Generator migrations | `ActiveRecord::Migration[8.0]` (tests assert) |
25
+
26
+ ## 4.3 Dart Sass / SCSS
27
+
28
+ Foundation + engine SCSS still emit Dart Sass 1.x deprecation warnings during `dartsass:build`. Accepted for 8.0 ship; migrate to `@use` / `color.scale` before Dart Sass 3.0 (see `stuff/pipeline.md`).
29
+
30
+ ## 4.4 bundler-audit
31
+
32
+ | Lockfile | Result (2026-05-22) |
33
+ |----------|---------------------|
34
+ | `validation_hints/Gemfile.lock` | No vulnerabilities found |
35
+ | Example app `MyApp/Gemfile.lock` | No vulnerabilities found (`bundler-audit` on default gemset) |
36
+
37
+ ## 4.5 Example app gate (unchanged baseline)
38
+
39
+ `inline_forms create MyApp -d sqlite --example` → **88 runs, 502 assertions, 0 failures, 0 errors, 0 skips** (Phase 3, Rails 8.0.5 stack).
@@ -0,0 +1,56 @@
1
+ # Rails 8.0 release (8.0.x line)
2
+
3
+ **Shipped:** 2026-05-22
4
+ **Tags:** `v8.0.3` (inline_forms, inline_forms_installer, validation_hints)
5
+
6
+ ## Stack
7
+
8
+ | Component | Constraint |
9
+ |-----------|------------|
10
+ | Ruby | `>= 4.0` (generated apps: `ruby-4.0.4`) |
11
+ | Rails | `>= 8.0`, `< 8.1` |
12
+ | rails-i18n | `>= 8.0`, `< 9.0` |
13
+ | validation_hints | `>= 8.0.2`, `< 9.0` (release **8.0.3** lockstep) |
14
+
15
+ Install CLI:
16
+
17
+ ```bash
18
+ gem install inline_forms_installer
19
+ inline_forms create MyApp -d sqlite --example
20
+ ```
21
+
22
+ Pre-release local builds: installer auto-installs `*.gem` from `~/inline_forms` / `~/validation_hints` when present (no `path:` in consumer Gemfiles).
23
+
24
+ ## Verification gate (2026-05-22)
25
+
26
+ | Check | Result |
27
+ |-------|--------|
28
+ | validation_hints `rake test` | 24 runs, 50 assertions, 0 failures |
29
+ | inline_forms `rake test` | 24 runs, 89 assertions, 0 failures |
30
+ | `inline_forms create MyApp -d sqlite --example` | OK (Rails 8.0.5) |
31
+ | `bundle exec rails zeitwerk:check` | All is good! |
32
+ | `bundle exec rails test` (MyApp) | **88 runs, 502 assertions, 0 failures, 0 errors, 0 skips** |
33
+ | `bundler-audit` (validation_hints lockfile) | No vulnerabilities found |
34
+
35
+ ## Migration phases (maintainer runbook)
36
+
37
+ Canonical step-by-step: `stuff/rails8forReal.md` (local; gitignored in this repo). Mirror checklist: `validation_hints/stuff/rails-8-checklist.md`.
38
+
39
+ | Phase | Status |
40
+ |-------|--------|
41
+ | 0 Baseline | Done |
42
+ | 1 validation_hints → AR 8 | Done (8.0.1+) |
43
+ | 2 inline_forms engine → Rails 8 | Done (8.0.1+) |
44
+ | 3 Installer + example app | Done (8.0.2+) |
45
+ | 4 Framework defaults + audit | Done (8.0.3) — [`rails-8-phase4-audit.md`](rails-8-phase4-audit.md) |
46
+ | 5 Release + docs | Done (8.0.3) — this file |
47
+
48
+ ## Zeitwerk
49
+
50
+ See [`zeitwerk-and-load-paths.md`](zeitwerk-and-load-paths.md). No remaining active code on pre-Zeitwerk `app/helpers/form_elements/` paths.
51
+
52
+ ## Deferred
53
+
54
+ - Dart Sass 3.0 (`@import` removal) — not released; deprecations only on Dart Sass 1.x
55
+ - [`stuff/towards_rails_8.md`](../stuff/towards_rails_8.md) product bets (auth, encryption, …) — post-ship
56
+ - Asset pipeline (`stuff/pipeline.md`) — orthogonal
@@ -0,0 +1,49 @@
1
+ # Zeitwerk and load paths (inline_forms + validation_hints)
2
+
3
+ **Last verified:** 2026-05-22 — `bundle exec rails zeitwerk:check` on a fresh **`inline_forms create MyApp -d sqlite --example`** app (Rails **8.0.5**): **All is good!**
4
+
5
+ ## inline_forms engine
6
+
7
+ ### Autoloaded by Zeitwerk (host app eager load)
8
+
9
+ Under the engine’s `app/` tree:
10
+
11
+ - `app/controllers/` — `InlineFormsController`, concerns
12
+ - `app/helpers/inline_forms_helper.rb`
13
+ - `app/models/concerns/inline_forms/soft_deletable.rb`
14
+ - `app/validators/*` — custom validators
15
+
16
+ ### Intentionally **not** Zeitwerk-autoloaded
17
+
18
+ | Path | Mechanism | Why |
19
+ |------|-----------|-----|
20
+ | `lib/inline_forms/form_elements/*_helper.rb` | `Rails.autoloaders.main.ignore` + `FormElements.load_helpers!` (`Dir[]` + `require`) | Historical top-level helper method names (`text_field_show`, …); `_helper.rb` filenames do not map to Zeitwerk constants |
21
+ | `lib/inline_forms.rb` boot | Explicit `require` of version, registry, `form_elements`, `turbo_tabs_builder`, `archived_form_elements` | Boot order before engine initializers |
22
+ | `lib/generators/` | Rails generator autoload | Not part of host app Zeitwerk |
23
+ | `archived/form_elements/` | Not required | Legacy project-specific elements; registry blocks use in `inline_forms_attribute_list` |
24
+
25
+ Track B migration (7.13.x): moved active elements from `app/helpers/form_elements/*.rb` to `lib/inline_forms/form_elements/*_helper.rb`. See `CHANGELOG.md` (Zeitwerk / form elements).
26
+
27
+ ### Nothing left on the old path
28
+
29
+ There is **no** `app/helpers/form_elements/` in the shipped gem (only under `archived/`).
30
+
31
+ ## validation_hints
32
+
33
+ | Path | Mechanism | Why |
34
+ |------|-----------|-----|
35
+ | `lib/active_model/hints.rb` | Explicit `require` in `lib/validation_hints.rb` | Defines `ActiveModel::Hints` in the `ActiveModel` namespace (collapse); not under `validation_hints/` |
36
+ | `lib/validation_hints/validations_patch.rb` | Explicit `require` | Patches applied via `ActiveSupport.on_load(:active_model)` |
37
+ | `lib/validation_hints/railtie.rb` | Loaded when `Rails::Railtie` is defined | Standard gem entry |
38
+
39
+ Non-Rails use: `require "validation_hints"` loads hints + patch + I18n without Zeitwerk.
40
+
41
+ ## Host app checklist
42
+
43
+ After upgrading or generating an app:
44
+
45
+ ```bash
46
+ cd MyApp && rvm use . && bundle exec rails zeitwerk:check
47
+ ```
48
+
49
+ If you vendor custom form-element helpers into the host app, keep them under `app/helpers/` with Zeitwerk-friendly names or add `config.autoload_lib` / ignores as needed.
data/inline_forms.gemspec CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |s|
10
10
  s.authors = ["Ace Suares", "Lemuel Boyce", "Manuel Ortega"]
11
11
  s.email = ["ace@suares.com"]
12
12
  s.homepage = %q{http://github.com/acesuares/inline_forms}
13
- s.summary = %q{Inline editing of forms. Versions after 6.2.14 are currently broken.}
14
- s.description = %q{Inline Forms aims to ease the setup of forms that provide inline editing. The field list can be specified in the model. Versions after 6.2.14 are currently broken, and we will post a notice when the gem is good again.}
13
+ s.summary = %q{Inline editing of forms for Rails 8.}
14
+ s.description = %q{Inline Forms eases setup of admin-style forms with inline editing. Field lists are declared on the model. Requires Rails 8.0.x, Ruby >= 4.0, and validation_hints ~> 8.}
15
15
  s.licenses = ["MIT"]
16
16
  s.required_ruby_version = ">= 4.0.0"
17
17
 
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_dependency("validation_hints", ">= 8.0.1", "< 9.0")
22
+ s.add_dependency("validation_hints", ">= 8.0.4", "< 9.0")
23
23
  s.add_dependency("rails", ">= 8.0", "< 8.1")
24
24
  s.add_dependency("rails-i18n", ">= 8.0", "< 9.0")
25
25
 
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineForms
3
- VERSION = "8.0.2"
3
+ VERSION = "8.0.4"
4
4
  end
@@ -0,0 +1,43 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require "minitest/autorun"
3
+ require "inline_forms_installer/user_model_config"
4
+
5
+ class UserModelConfigTest < Minitest::Test
6
+ def test_default_user
7
+ cfg = InlineFormsInstaller::UserModelConfig.from_name("User")
8
+ assert cfg.default?
9
+ assert_equal "users", cfg.table_name
10
+ assert_equal "devise_for :users, :path_prefix => 'auth'", cfg.devise_route_line
11
+ assert_equal "/auth/users/sign_in", cfg.sign_in_path_fragment
12
+ end
13
+
14
+ def test_member
15
+ cfg = InlineFormsInstaller::UserModelConfig.from_name("Member")
16
+ refute cfg.default?
17
+ assert_equal "Member", cfg.class_name
18
+ assert_equal "members", cfg.table_name
19
+ assert_equal "member_id", cfg.foreign_key
20
+ assert_equal "members_roles", cfg.join_table
21
+ assert_equal "MembersController", cfg.controller_name
22
+ assert_includes cfg.devise_route_line, 'class_name: "Member"'
23
+ assert_includes cfg.devise_route_line, 'path: "members"'
24
+ assert_equal "/auth/members/sign_in", cfg.sign_in_path_fragment
25
+ end
26
+
27
+ def test_adapts_example_tests
28
+ cfg = InlineFormsInstaller::UserModelConfig.from_name("Member")
29
+ src = "user = User.find_or_initialize_by(email: \"admin@example.com\")\n"
30
+ assert_includes cfg.adapt_example_test_source(src), "Member.find_or_initialize_by"
31
+ guest = "assert_match %r{/auth/users/sign_in}, @response.redirect_url\n"
32
+ assert_includes cfg.adapt_example_test_source(guest), "/auth/members/sign_in"
33
+ end
34
+
35
+ def test_rejects_invalid_constant
36
+ assert_raises(ArgumentError) { InlineFormsInstaller::UserModelConfig.from_name("not-a-class") }
37
+ end
38
+
39
+ def test_from_env_defaults_to_user
40
+ env = { "user_model" => "" }
41
+ assert InlineFormsInstaller::UserModelConfig.from_env(env).default?
42
+ end
43
+ end
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: 8.0.2
4
+ version: 8.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares
@@ -17,7 +17,7 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 8.0.1
20
+ version: 8.0.4
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
23
  version: '9.0'
@@ -27,7 +27,7 @@ dependencies:
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: 8.0.1
30
+ version: 8.0.4
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '9.0'
@@ -85,9 +85,9 @@ dependencies:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
87
  version: '5.0'
88
- description: Inline Forms aims to ease the setup of forms that provide inline editing.
89
- The field list can be specified in the model. Versions after 6.2.14 are currently
90
- broken, and we will post a notice when the gem is good again.
88
+ description: Inline Forms eases setup of admin-style forms with inline editing. Field
89
+ lists are declared on the model. Requires Rails 8.0.x, Ruby >= 4.0, and validation_hints
90
+ ~> 8.
91
91
  email:
92
92
  - ace@suares.com
93
93
  executables: []
@@ -496,8 +496,11 @@ files:
496
496
  - docs/jquery-widgets.md
497
497
  - docs/prompt/.gitignore
498
498
  - docs/prompt/test-the-example-app.md
499
+ - docs/rails-8-phase4-audit.md
500
+ - docs/rails-8-release.md
499
501
  - docs/turbo-stream-audit.md
500
502
  - docs/ujs-to-turbo.md
503
+ - docs/zeitwerk-and-load-paths.md
501
504
  - inline_forms.gemspec
502
505
  - lib/generators/USAGE
503
506
  - lib/generators/assets/stylesheets/inline_forms.scss
@@ -568,6 +571,7 @@ files:
568
571
  - test/inline_forms_generator_test.rb
569
572
  - test/plain_text_configuration_test.rb
570
573
  - test/test_helper.rb
574
+ - test/user_model_config_test.rb
571
575
  - vendor/assets/javascripts/popper.min.js
572
576
  - vendor/assets/javascripts/tippy-bundle.umd.min.js
573
577
  - vendor/assets/stylesheets/tippy.css
@@ -591,7 +595,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
591
595
  requirements: []
592
596
  rubygems_version: 4.0.10
593
597
  specification_version: 4
594
- summary: Inline editing of forms. Versions after 6.2.14 are currently broken.
598
+ summary: Inline editing of forms for Rails 8.
595
599
  test_files:
596
600
  - test/archived_form_elements_test.rb
597
601
  - test/form_element_from_callee_test.rb
@@ -599,3 +603,4 @@ test_files:
599
603
  - test/inline_forms_generator_test.rb
600
604
  - test/plain_text_configuration_test.rb
601
605
  - test/test_helper.rb
606
+ - test/user_model_config_test.rb