sanger/sequencescape

View on GitHub
app/models/comments_proxy/tube.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

# Tube comments follow a similar proxy pattern to plate comments
class CommentsProxy::Tube < CommentsProxy::Base
  private

  def request_ids
    @commentable.requests_as_source.ids.presence ||
      @commentable.aliquots.where.not(request_id: nil).distinct.pluck(:request_id)
  end
end