Class: MultiPoolPosition
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- MultiPoolPosition
- Defined in:
- app/models/multi_pool_position.rb
Overview
MultiPoolPosition An instance of a pool in a MultiPool at a specific position.
Instance Method Summary collapse
- #pipeline ⇒ Object
-
#pool_presence ⇒ Object
Validate that at least one pool is associated We can’t validate pool relationship presence because it’s polymorphic and may be nil during nested creation within multi_pool_positions.
Instance Method Details
#pipeline ⇒ Object
34 35 36 37 38 39 40 |
# File 'app/models/multi_pool_position.rb', line 34 def pipeline if pacbio_pool.present? :pacbio elsif ont_pool.present? :ont end end |
#pool_presence ⇒ Object
Validate that at least one pool is associated We can’t validate pool relationship presence because it’s polymorphic and may be nil during nested creation within multi_pool_positions
23 24 25 26 27 |
# File 'app/models/multi_pool_position.rb', line 23 def pool_presence return unless pacbio_pool.nil? && ont_pool.nil? errors.add(:pool, 'must have either a pacbio_pool or ont_pool associated') end |