I think this is obvious. but for some reason I’m not getting it.
Models: Bicycles, Accessories
Join Model: Upgrades
The idea is that you can upgrade your bike by adding an accessory, and
the upgrade price is often less than the accessory price would normally
be. So the Upgrades table has id, bicycle_id, accessory_id, and price.
has_many :accessories, :through => :upgrades
price defined in table
Now my question is, I need to query the upgrades for a bicycle for a
I was doing this:
accessory = Accessory.find_by_description(“headlight”)
but it seems klunky. Is there a better way to perform this kind of