Hello Folks,
I'm trying to set up a Band model that uses one lookup table
(Instruments) to describe two things:
1. Instruments that the Band currently plays
2. 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
Band model:
class Band < ActiveRecord::Base
attr_accessible :name, :description, :genre_ids, :instrument_ids
# Band Instruments played
has_many :band_plays_instruments
has_many :instruments, :through => :band_plays_instruments
# Band Instruments needed
has_many :band_instrument_needs
has_many :instruments, :through => :band_instrument_needs
end
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!
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.