search for: find_by_accessory_id

Displaying 1 result from an estimated 1 matches for "find_by_accessory_id".

2007 Jan 26
6
has_many :through query question
...:upgrades end class Upgrade belongs_to :bicycle belongs_to :accessory # price defined in table end Now my question is, I need to query the upgrades for a bicycle for a specific accessory. I was doing this: accessory = Accessory.find_by_description("headlight") bike.upgrades.find_by_accessory_id(accessory.id) but it seems klunky. Is there a better way to perform this kind of lookup? Thanks Jeff --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, sen...