inline_forms_installer 8.1.3 → 8.1.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: 6b4f54ce386e1f7b9b8052cb1817c837a94a1cb4b315887a19456d1c054f8a28
4
- data.tar.gz: 2597296ce7e66de213ba8eef07191b924c355258f45210cbf6380c1ffa695891
3
+ metadata.gz: 8aab65c5a20c0e070c304623d7498286d6cb8c06d883863d309c8005a230aaa5
4
+ data.tar.gz: 6a241f0384dc7f8bbee8aa1d61cc08c2226ee1ce93ea6ae584f8f455906e8a77
5
5
  SHA512:
6
- metadata.gz: 6517c3d2c92010b5f9f8032206e8bad5d14bf5d11b77c186d807fed490680534952d136aa2e63ebd485878d17561a66a7c7477126fface669d447e63d69aa245
7
- data.tar.gz: 243c4dee8186095ec2d8fd84a34a204bcf6deecf74360e01069b3396435dfad83fc12162fb347d704bf51e6a95301b9ef768b93185551f763523e6344fee27cd
6
+ metadata.gz: 46b0762a885fcb3e9a56f47e8b91f6f26f4b6a2091548813923b1f9bb902fc604d3c4769dd7b561d80d0bc4b80a18b28abec4cdb515aa3c62b7b7317628f615c
7
+ data.tar.gz: ae5781053e3daf55d8336b533e76ed3e696032cbb62d3e0d74ed5e004a19faf2ca426b4cf4a56f3cc983b0761b0ca18fd0b62f3217d4276d35491acd53e4c949
@@ -368,6 +368,11 @@ create_file user_cfg.model_path, <<-USER_MODEL.strip_heredoc
368
368
  # via `#{user_cfg.class_name}.inline_forms_list`). Avoids `default_scope`
369
369
  # so callers can `unscope`/`reorder` cleanly when needed.
370
370
  scope :inline_forms_list, -> { order(:name, :id) }
371
+ # Search box on /#{user_cfg.plural_route} filters by name OR email. Without this
372
+ # the controller would `merge(ApplicationRecord.inline_forms_search(q))`,
373
+ # which is the no-op `all` fallback, and the query string would be silently
374
+ # ignored.
375
+ scope :inline_forms_search, ->(q) { where("name LIKE :q OR email LIKE :q", q: "%\#{q}%") }
371
376
 
372
377
  def _presentation
373
378
  "\#{name}"
@@ -404,6 +409,18 @@ create_file user_cfg.model_path, <<-USER_MODEL.strip_heredoc
404
409
  end
405
410
  USER_MODEL
406
411
 
412
+ # inline_forms initializer (must exist before subsequent `rails g inline_forms`
413
+ # runs so the generator's `add_tab` step can inject each generated model's
414
+ # route token into `MODEL_TABS`). Pre-seeded with the user-model route
415
+ # (the user model is hand-written above, not generated, so the generator
416
+ # never sees it).
417
+ say "- Creating inline_forms initializer (MODEL_TABS seeded with #{user_cfg.plural_route})"
418
+ create_file "config/initializers/inline_forms.rb", <<-END_INITIALIZER.strip_heredoc
419
+ Rails.application.reloader.to_prepare do
420
+ MODEL_TABS = %w(#{user_cfg.plural_route} )
421
+ end
422
+ END_INITIALIZER
423
+
407
424
  # Create Locales
408
425
  say "- Create locales"
409
426
  generate "inline_forms", "Locale name:string title:string #{user_cfg.table_name}:has_many _enabled:yes _list_order:title _presentation:\#{title}"
@@ -545,13 +562,6 @@ create_file "app/helpers/application_helper.rb", <<-END_APPHELPER.strip_heredoc
545
562
  end
546
563
  END_APPHELPER
547
564
 
548
- say "- Creating inline_forms initializer"
549
- create_file "config/initializers/inline_forms.rb", <<-END_INITIALIZER.strip_heredoc
550
- Rails.application.reloader.to_prepare do
551
- MODEL_TABS = %w()
552
- end
553
- END_INITIALIZER
554
-
555
565
  say "- Recreating ApplicationController to add devise, cancan, I18n stuff..."
556
566
  remove_file "app/controllers/application_controller.rb" # the one that 'rails new' created
557
567
  create_file "app/controllers/application_controller.rb", <<-END_APPCONTROLLER.strip_heredoc
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineFormsInstaller
3
- VERSION = "8.1.3"
3
+ VERSION = "8.1.4"
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"
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.3
4
+ version: 8.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares