From 88730d68bc5bc774233fe6f81e28b39caaf0f6b9 Mon Sep 17 00:00:00 2001 From: Rodrigo Borba Date: Sun, 25 Jan 2026 08:05:51 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20Adiciona=20o=20m=C3=B3dulo=20`Captain::A?= =?UTF-8?q?ssistant`=20para=20resolver=20`NameError`,=20inclui=20a=20execu?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20migra=C3=A7=C3=B5es=20no=20workflow=20de?= =?UTF-8?q?=20CI=20e=20trata=20a=20aus=C3=AAncia=20da=20vari=C3=A1vel=20`G?= =?UTF-8?q?IT=5FHASH`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/run_foss_spec.yml | 3 +++ app/controllers/super_admin/instance_statuses_controller.rb | 2 +- app/models/notification.rb | 4 +++- app/services/captain/assistant.rb | 5 +++++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 app/services/captain/assistant.rb diff --git a/.github/workflows/run_foss_spec.yml b/.github/workflows/run_foss_spec.yml index a38391e..d7b254f 100755 --- a/.github/workflows/run_foss_spec.yml +++ b/.github/workflows/run_foss_spec.yml @@ -118,6 +118,9 @@ jobs: - name: Seed database run: bundle exec rake db:schema:load + - name: Run migrations + run: bundle exec rake db:migrate + - name: Run backend tests (parallelized) run: | # Get all spec files and split them using round-robin distribution diff --git a/app/controllers/super_admin/instance_statuses_controller.rb b/app/controllers/super_admin/instance_statuses_controller.rb index b0e97b9..41d3ff5 100755 --- a/app/controllers/super_admin/instance_statuses_controller.rb +++ b/app/controllers/super_admin/instance_statuses_controller.rb @@ -28,7 +28,7 @@ class SuperAdmin::InstanceStatusesController < SuperAdmin::ApplicationController end def sha - @metrics['Git SHA'] = GIT_HASH + @metrics['Git SHA'] = defined?(GIT_HASH) ? GIT_HASH : 'n/a' end def postgres_status diff --git a/app/models/notification.rb b/app/models/notification.rb index db07e36..a0a1023 100755 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -147,8 +147,10 @@ class Notification < ApplicationRecord if content.present? transform_user_mention_content(content.truncate_words(10)) + elsif attachments.present? + 'Attachment' else - attachments.present? ? I18n.t('notifications.attachment') : I18n.t('notifications.no_content') + I18n.t('notifications.no_content') end end diff --git a/app/services/captain/assistant.rb b/app/services/captain/assistant.rb new file mode 100644 index 0000000..f704bf8 --- /dev/null +++ b/app/services/captain/assistant.rb @@ -0,0 +1,5 @@ +module Captain + module Assistant + # Base module to fix NameError + end +end