A model has 2 columns in its table
asset_type_id
asset_id
the asset_type_id links directly to the table asset_types via a
belongs_to
asset_types contains a single column ‘name’
method_missing in the model says when you call a method matching
/^asset.*/
call the corresponding method substituting ‘asset’ for the contents of
asset_type.name
(ie. the name in asset_types is the name of a table&model)
So far it works wonderfully. However, I would like to be able to eagerly
load via the assets.
Does any one know what I would have to do to to make this work without
eager loading all of the possible types of assets
(ie. eager load all models that exist in table asset_types)