add has_may requested_merge_from
This commit is contained in:
parent
d1162d7493
commit
17d131b3cc
2 changed files with 3 additions and 1 deletions
|
@ -61,7 +61,7 @@ module Users
|
|||
end
|
||||
|
||||
def users_requesting_merge
|
||||
@requesting_merge ||= User.where(requested_merge_into: current_user)
|
||||
@requesting_merge ||= current_user.requested_merge_from
|
||||
end
|
||||
|
||||
def ensure_update_email_is_authorized
|
||||
|
|
|
@ -49,6 +49,8 @@ class User < ApplicationRecord
|
|||
has_many :dossiers_invites, through: :invites, source: :dossier
|
||||
has_many :deleted_dossiers
|
||||
has_many :merge_logs, dependent: :destroy
|
||||
has_many :requested_merge_from, class_name: 'User', dependent: :nullify, inverse_of: :requested_merge_into, foreign_key: :requested_merge_into_id
|
||||
|
||||
has_one :france_connect_information, dependent: :destroy
|
||||
belongs_to :instructeur, optional: true, dependent: :destroy
|
||||
belongs_to :administrateur, optional: true, dependent: :destroy
|
||||
|
|
Loading…
Reference in a new issue