I’m trying to set up a Band model that uses one lookup table
(Instruments) to describe two things:
- Instruments that the Band currently plays
- Instruments that the Band needs
I only want to have one Instruments table to describe all instruments
for maintainability. Is there a way to do this? Here is my current
class Band < ActiveRecord::Base
attr_accessible :name, :description, :genre_ids, :instrument_ids
Band Instruments played
has_many :instruments, :through => :band_plays_instruments
Band Instruments needed
has_many :instruments, :through => :band_instrument_needs
The problem is that apparently I can’t have two
“has_many :instruments, :through => x” statements in the model. Does
anybody have any recommendations as to how I should handle this?
Thank you in advance!