[#1677] Extract Dossier#invite_for_user

This commit is contained in:
Frederic Merizen 2018-03-29 15:42:06 +02:00
parent 884c430619
commit 13d7149b5c

View file

@ -191,7 +191,11 @@ class Dossier < ApplicationRecord
end
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
def can_be_en_construction?