From b5197fe6d3f5da782d629a4add0051853a6f4a2a Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 10 Nov 2025 16:10:25 -0500 Subject: [PATCH] Fix notifications to use the user's account --- app/helpers/avatars_helper.rb | 2 +- app/models/notification.rb | 2 +- app/models/notification/bundle.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb index f572434ec..8fb42448a 100644 --- a/app/helpers/avatars_helper.rb +++ b/app/helpers/avatars_helper.rb @@ -38,6 +38,6 @@ module AvatarsHelper end def avatar_image_tag(user, **options) - image_tag user_avatar_url(user), aria: { hidden: "true" }, size: 48, title: user.name, **options + image_tag user_avatar_url(user, script_name: user.account.slug), aria: { hidden: "true" }, size: 48, title: user.name, **options end end diff --git a/app/models/notification.rb b/app/models/notification.rb index fa9baaf48..8e6010acd 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -1,7 +1,7 @@ class Notification < ApplicationRecord include PushNotifiable - belongs_to :account, default: -> { Current.account } + belongs_to :account, default: -> { user.account } belongs_to :user belongs_to :creator, class_name: "User" belongs_to :source, polymorphic: true diff --git a/app/models/notification/bundle.rb b/app/models/notification/bundle.rb index ab02fc93d..a4d87e72d 100644 --- a/app/models/notification/bundle.rb +++ b/app/models/notification/bundle.rb @@ -1,5 +1,5 @@ class Notification::Bundle < ApplicationRecord - belongs_to :account, default: -> { Current.account } + belongs_to :account, default: -> { user.account } belongs_to :user enum :status, %i[ pending processing delivered ]