From b4f850e97aeb12369399d8e1ab354f66d3b88e40 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 27 Jun 2026 02:39:55 +0200 Subject: Stage 6 click-testing fixes and production setup - file_attachment.rb: delete old upload directory before writing replacement files; fixes orphaned variants when filename or mime type changes - assets/edit.html.erb: add file upload field and current file display; the form was previously empty and non-functional - admin.css: fix button_to hover styling; buttons now show orange hover to signal interactivity - test/controllers/users_controller_test.rb: assert input[type=submit] not anchor tag for destroy action (button_to change) - test/test_helper.rb: add I18n.locale reset in setup block - doc/rc.d_cccms: fix cccms_chdir, add start_precmd for log/pid dirs, PATH export for bash wrapper, user/pid/tcp_nopush unicorn fixes - doc/INSTALL.md: new installation guide covering all non-obvious steps - Remove parked search migration from doc/ (now in db/migrate/) --- app/models/concerns/file_attachment.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/models') diff --git a/app/models/concerns/file_attachment.rb b/app/models/concerns/file_attachment.rb index 5483de5..e9acda6 100644 --- a/app/models/concerns/file_attachment.rb +++ b/app/models/concerns/file_attachment.rb @@ -60,6 +60,9 @@ module FileAttachment uploaded_file = @pending_upload @pending_upload = nil + old_dir = Rails.root.join("public", "system", "uploads", id.to_s) + FileUtils.rm_rf(old_dir) if Dir.exist?(old_dir) + original_path = file_path(:original) FileUtils.mkdir_p(File.dirname(original_path)) FileUtils.cp(uploaded_file.tempfile.path, original_path) -- cgit v1.3