app/models/publication.rb
def related_models
    via_assay = assays.collect do |assay|
      assay.models
    end.flatten.uniq.compact
    via_assay | models
  end
#includes those related directly, or through an assay
includes those related directly, or through an assay
includes those related directly or through an assay
def related_models
    via_assay = assays.collect do |assay|
      assay.models
    end.flatten.uniq.compact
    via_assay | models
  end
def related_models via_assay = assays . collect do | assay | assay . models end . flatten . uniq . compact via_assay | models end
includes those related directly, or through an assay
includes those related directly or through an assay