Fix tests after the removal of memberships

This commit is contained in:
Stanko K.R.
2025-11-13 16:58:17 +01:00
committed by Mike Dalessio
parent 8fa9566c07
commit 34d83aaa7c
27 changed files with 84 additions and 360 deletions
+1 -1
View File
@@ -1,8 +1,8 @@
class Board < ApplicationRecord
include Accessible, AutoPostponing, Broadcastable, Cards, Entropic, Filterable, Publishable, Triageable
belongs_to :account, default: -> { creator.account }
belongs_to :creator, class_name: "User", default: -> { Current.user }
belongs_to :account, default: -> { creator.account }
has_rich_text :public_description
+10 -2
View File
@@ -7,8 +7,16 @@ class Current < ActiveSupport::CurrentAttributes
def session=(value)
super(value)
if value.present? && Current.account.present?
self.user = identity.users.find_by(account: Current.account)
if value.present? && account.present?
self.user = identity.users.find_by(account: account)
end
end
def account=(value)
super(value)
if value.present? && identity.present?
self.user = identity.users.find_by(account: value)
end
end
end
+1 -1
View File
@@ -20,7 +20,7 @@ class User < ApplicationRecord
def deactivate
transaction do
accesses.destroy_all
update! active: false
update! active: false, identity: nil
end
end
end