Skip to content

Commit

Permalink
Fixes over distractor samples values on report creation (#1977)
Browse files Browse the repository at this point in the history
* Fixes over distractor samples values on report creation

* Lint fix
  • Loading branch information
leandroradusky authored Jul 27, 2023
1 parent ec89daa commit b7c9b15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/samples_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def calculate_lod_and_lob

# Returns any sample that isn't a distractor.
def target_sample
samples.where.not(distractor: true).take!
target_sample = samples.find_by("distractor IS NULL or distractor = ?", false)
target_sample ||= samples.take
end

private
Expand Down

0 comments on commit b7c9b15

Please sign in to comment.