[#1677] Extract Dossier#invite_for_user
This commit is contained in:
parent
884c430619
commit
13d7149b5c
1 changed files with 5 additions and 1 deletions
|
@ -191,7 +191,11 @@ class Dossier < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def owner_or_invite?(user)
|
def owner_or_invite?(user)
|
||||||
self.user == user || invites_user.find_by(user_id: user.id).present?
|
self.user == user || invite_for_user(user).present?
|
||||||
|
end
|
||||||
|
|
||||||
|
def invite_for_user(user)
|
||||||
|
invites_user.find_by(user_id: user.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def can_be_en_construction?
|
def can_be_en_construction?
|
||||||
|
|
Loading…
Reference in a new issue