Skip to content
Snippets Groups Projects
Commit 03ceb837 authored by Gyan Gupta's avatar Gyan Gupta
Browse files

some changes

parent d0efa3f0
No related tags found
1 merge request!287Fixed duplication title issue for Subject, Session And Modality
Pipeline #13443 failed
......@@ -62,7 +62,7 @@ class ComplexModality < ActiveRecord::Base
suffix = 1
new_title = self.modality_title
while ComplexModality.where(modality_title: new_title).where.not(id: self.id).present?
while ComplexModality.where(modality_title: new_title, parent_source_identifier: complex_session.source_identifier).where.not(id: self.id).present?
new_title = "#{self.modality_title}_#{suffix}"
suffix += 1
end
......
......@@ -63,7 +63,7 @@ class ComplexSession < ActiveRecord::Base
suffix = 1
new_title = session_title
while ComplexSession.where(session_title: new_title).where.not(id: self.id).present?
while ComplexSession.where(session_title: new_title, parent_source_identifier: complex_subject.source_identifier).where.not(id: self.id).present?
new_title = "#{self.session_title}_#{suffix}"
suffix += 1
end
......
......@@ -64,7 +64,7 @@ class ComplexSubject < ActiveRecord::Base
suffix = 1
new_title = self.subject_title
while ComplexSubject.where(subject_title: new_title).where.not(id: self.id).present?
while ComplexSubject.where(subject_title: new_title, parent_source_identifier: crc_dataset.source.first).where.not(id: self.id).present?
new_title = "#{self.subject_title}_#{suffix}"
suffix += 1
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment