Skip to content

Commit 0c0b397

Browse files
committed
Improve performnace of inter_team_move check
Use patient_id to determine if the patient is persisted or not. This method is only called after patient_ids are assigned to the changeset in the commit job. So all changesets should have a patient_id.
1 parent 2e59f01 commit 0c0b397

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/models/patient_changeset.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def deserialize_attribute(attributes, key, type)
372372
end
373373

374374
def inter_team_move?
375-
return false unless patient.persisted? && school_move.present?
375+
return false unless patient_id.present? && school_move.present?
376376

377377
school_move.from_another_team?
378378
end

0 commit comments

Comments
 (0)