Skip to content

Commit

Permalink
refactor(request-type): simplifies morphologies validation
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTopping committed Nov 15, 2024
1 parent 8f3107d commit cc16f72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/request_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class RequestTypePlatePurpose < ApplicationRecord
# eg. library_creation has a lower order than sequencing
validates :order, presence: true
validates :order, numericality: { integer_only: true }
validates :morphology, numericality: { in: 0..2 } # 0..2 is the range of morphologies as defined in ln36-41
validates :morphology, numericality: { in: 0...MORPHOLOGIES.length }
validates :request_class, presence: true, inclusion: { in: ->(_) { [Request, *Request.descendants] } }

serialize :request_parameters
Expand Down

0 comments on commit cc16f72

Please sign in to comment.