Sha256: 48a8e1d5dbb962a05cb45c8c7ac738f76bab0b65ad54a6824076cdfaf3c8f21b

Contents?: true

Size: 367 Bytes

Versions: 1

Compression:

Stored size: 367 Bytes

Contents

class TaxonItem < ApplicationRecord
  belongs_to :taxon, polymorphic: true
  belongs_to :item
  belongs_to :list
  has_many :entity_items

  attr_accessor :value, :entity_item_id

  def item_options(list_id)
    item_ids = taxon.taxon_items.where(list_id: list_id).pluck(:item_id)
    Item.where(list_id: list_id).where.not(id: item_ids).pluck(:name, :id)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_detail-0.0.1 app/models/rails_detail/taxon_item.rb