Skip to content

Commit

Permalink
CV2-6041: apply PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
melsawy committed Feb 4, 2025
1 parent a87a748 commit e4f6e57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/relationship.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def create_or_update_parent_id
end

def self.create_unless_exists(source_id, target_id, relationship_type, options = {})
r = Relationship.where(source_id: source_id, target_id: target_id).where('relationship_type = ?', relationship_type.to_yaml).last
r = Relationship.where(target_id: target_id).last if r.nil?
r = Relationship.where(target_id: target_id).where.not(source_id: source_id).last
r = Relationship.where(source_id: source_id, target_id: target_id).where('relationship_type = ?', relationship_type.to_yaml).last unless r.nil?
exception_message = nil
exception_class = nil
if r.nil?
Expand Down

0 comments on commit e4f6e57

Please sign in to comment.