module JamRuby
  class MusicianInstrument < ActiveRecord::Base

    self.table_name = "musicians_instruments"

    self.primary_key = 'id'

    # ensure most proficient, highest priority
    default_scope order('proficiency_level DESC, priority ASC')

    belongs_to :user, :class_name => "JamRuby::User"
    belongs_to :instrument, :class_name => "JamRuby::Instrument"

    def description
      @description = self.instrument.description
    end
  end
end