[#2180] Refactor - extract local variable
This commit is contained in:
parent
530079e464
commit
d1c0418c89
1 changed files with 3 additions and 1 deletions
|
@ -184,6 +184,8 @@ class Procedure < ApplicationRecord
|
|||
end
|
||||
|
||||
def clone(admin, from_library)
|
||||
is_different_admin = self.administrateur_id != admin.id
|
||||
|
||||
populate_champ_stable_ids
|
||||
procedure = self.deep_clone(include:
|
||||
{
|
||||
|
@ -215,7 +217,7 @@ class Procedure < ApplicationRecord
|
|||
|
||||
if from_library
|
||||
procedure.service = nil
|
||||
elsif self.service.present? && (self.administrateur_id != admin.id)
|
||||
elsif self.service.present? && is_different_admin
|
||||
procedure.service = self.service.clone_and_assign_to_administrateur(admin)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue