On 6/28/06, Pete <pertl / gmx.org> wrote: > > Particularly because a model class can only map to one table. > > Why should that be the case? > > Did you try ActiveRecord::Base.set_table_name ? > > class SomeAsset < Asset > set_table_name 'some_asset' > end As Marcus mentioned, this lets you *change* the table for the model, but not *aggregate* multiple tables for the same model. The case Marcus proposed in his original post requires an aggregation of multiple tables to define one model. > Another approach would be to include the Asset base functionality using > 'include' > > class SomeAsset < ActiveRecord::Base > include Asset > end > > It should be more efficient than delegating methods... That's actually pretty much what I'm trying to achieve with my Asset::Delegator. The reason I can't just include Asset is 1) only modules can be included, as Marcus pointed out and 2) importing (or delegating) *all* of the methods from Asset can conflict with the already existing method_missing functionality for SomeAsset provided by ActiveRecord. So I threw together a quick example of a module that *can* be mixed in that feels like you're mixing in Asset itself, but with a limited method set. True, the number of methods that need to be enumerated in Asset::Delegator::AssetDelegates will probably be high, depending on usage, but I can't see anyway around that without polluting method_missing. Jacob Fugal