Forum: Ruby on Rails A "virtual model" that encapsulates other models?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Woei S. (Guest)
on 2006-03-24 15:37

Is it possible to have a model in rails that does not exist as a
database table by itself, but it exists solely by pulling data together
from tables used by other models?

For instance, let's say I have a model of a "customer" which has_many
"addresses", of which one of the "addresses" is the default address.

So what I'd like to do is to actually have a model, say
"Shipping_Addresses" that pulls "First name" and "Last name" out from
"customer" and sticks it to the rest of the address details as pulled
from "addresses".

Is this doable?
This topic is locked and can not be replied to.