Phase 0: in-place decoupling before WarpEngine extraction

- FileService/DownloadService: lazy container-path resolution instead of
  class-load-time realpath (boot no longer requires /softwares to exist)
- downloadCount/totalDownloads: single grouped query passed as Blueprinter
  option instead of per-release association counts (fixes N+1)
- admin Images: Member coupling replaced with ImageUsage owner registry
  (precursor of the WarpEngine.config.image_owners hook)
- Image: UPLOAD_PATH constant replaced with call-time upload_path accessor
- proper test environment (config/environments/test.rb, softwares_test DB,
  hosts.clear) — suite previously ran against the development DB
- spec fixes: case-insensitive uniqueness matchers (MySQL ai_ci collation),
  DB-cascade has_many expectations, PlatformLink::SUPPORTED_PLATFORMS
- JSON baselines of /api/software and /api/builds for post-extraction diffing

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-04 18:39:20 +02:00
co-authored by Claude Fable 5
parent 0f13c19fc8
commit bf921c589d
19 changed files with 851 additions and 32 deletions
+4
View File
@@ -11,6 +11,10 @@ development:
<<: *default
database: <%= ENV.fetch("DB_NAME", "softwares") %>
test:
<<: *default
database: <%= ENV.fetch("DB_NAME", "softwares") %>_test
production:
<<: *default
database: <%= ENV.fetch("DB_NAME", "softwares") %>
+15
View File
@@ -0,0 +1,15 @@
Rails.application.configure do
config.eager_load = false
config.consider_all_requests_local = true
config.cache_classes = true
config.action_controller.perform_caching = false
config.action_dispatch.show_exceptions = :rescuable
config.active_support.deprecation = :stderr
config.log_level = :warn
# Rack::Test example.org hostját ne blokkolja a host authorization
config.hosts.clear
end
@@ -0,0 +1,9 @@
# TTG-specifikus image-használók regisztrációja. to_prepare: reload után is újrafut.
Rails.application.config.to_prepare do
ImageUsage.reset!
ImageUsage.register(
label: "member",
image_ids: -> { Member.where.not(image_id: nil).distinct.pluck(:image_id) },
usage_label: ->(image) { "member" if Member.where(image_id: image.id).exists? }
)
end