From a1ddc25da0d2aa79a4d9216ef7792f26233bd38e Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 26 Jun 2026 05:19:28 +0200 Subject: Stage 5 fixes: RouteWithParams removal, Globalize fallbacks, search stub, to_s(:db) → to_fs(:db), LockedByAnotherUser autoload, test environment config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove safe_path helper and content_path shim from link_helper.rb - Update all safe_path call sites in views to use named route helpers directly - Fix Globalize fallbacks via config.i18n.fallbacks in application.rb, remove i18n initializer - Stub Node.search returning none (search disabled pending PostgreSQL upgrade) - Replace to_s(:db) with to_fs(:db) in node.rb, nodes_helper.rb, link_helper.rb, admin view - Move LockedByAnotherUser to app/models/locked_by_another_user.rb for Zeitwerk autoloading - Fix config/environments/test.rb: config.assets removed, cache_classes → enable_reloading, test_order removed, minitest pinned to ~> 5.25 - Fix config/environments/development.rb: cache_classes → enable_reloading - Park search vector migration in doc/ pending PostgreSQL and plpgsql availability --- app/models/node.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'app/models/node.rb') diff --git a/app/models/node.rb b/app/models/node.rb index f7a70d0..41c3867 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -73,7 +73,7 @@ class Node < ApplicationRecord raise( LockedByAnotherUser, "Page is locked by another user who is working on it! " \ - "Last modification: #{draft.updated_at.to_s(:db)}" + "Last modification: #{draft.updated_at.to_fs(:db)}" ) else lock_for! current_user @@ -211,6 +211,13 @@ class Node < ApplicationRecord self.created_at < new_id_format_date ? unique_path : id end + # TODO: restore full-text search once PostgreSQL is upgraded. + # The tsvector/plpgsql approach requires PostgreSQL 10+ with plpgsql available. + # For now, search is disabled to unblock the Rails 7.2 upgrade. + def self.search(term, _ = {}) + none + end + protected def lock_for! current_user self.lock_owner = current_user @@ -255,7 +262,3 @@ class Node < ApplicationRecord end end end - -class LockedByAnotherUser < StandardError; end - - -- cgit v1.3