Skip to content

Commit

Permalink
fix to api test #1973
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Sep 6, 2024
1 parent 99143a9 commit 0995d86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/assay.rb
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,12 @@ def self.filter_by_projects(projects)
private

def study_matches_observation_units_if_present
return if samples.empty?
samples.each do |sample|
if sample.observation_unit && sample.observation_unit.study != study
if sample.observation_unit && sample.observation_unit.study != study
errors.add(:study, 'must match the associated observation unit')
return false
end
end
end
end

Expand Down
1 change: 1 addition & 0 deletions app/models/observation_unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def related_publication_ids
private

def study_matches_assays_if_present
return if samples.empty?
samples.each do |sample|
sample.assays.each do |assay|
if assay.study != study
Expand Down

0 comments on commit 0995d86

Please sign in to comment.