class InstitutionItem < ActiveRecord::Base
  attr_accessible :institution_inventory_category_id, :name, :description, :brand, :market_value, :current_value, :acquisition_date

  belongs_to :institution_inventory_category

  validates :name, :description, :brand, :market_value, presence: true

  attr_accessible :file
  has_attached_file :file


  def data_for_csv
    [
      name,
      description,
      brand,
      market_value,
      current_value,
      acquisition_date
    ]
  end

  def self.header_for_csv
    [:name, :description, :brand, :market_value, :current_value, :acquisition_date]
  end

  def self.attributes_for_grid
    [
      :name,
      :description,
      :brand,
      :market_value,
      :current_value,
      :acquisition_date
    ]
  end

end
