Fix tests after the removal of memberships
This commit is contained in:
committed by
Mike Dalessio
parent
8fa9566c07
commit
34d83aaa7c
+1
-1
@@ -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
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user