search for: has_belongs_to_many

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

2006 Feb 27
1
Models and Inheritance
I have a table of companies and a join table forming the relationship between a list of possible services they can provide. Working from a basic understanding of OOP I assumed that there should be a series of Serviceprovider child objects of the company class. Company < ActiveRecord::Base has_belongs_to_many :services end Serviceprovidertype1 < Company Serviceprovidertype2 < Company These child classes have corresponding child controllers Serviceprovidertype1Controller < CompanyController in the parent I have a method protected list_by_service(service) Company.find_by_sql(.. + service...