Forum: Ruby on Rails Associating ActiveRecord and non-ActiveRecord objects

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.
Evan (Guest)
on 2009-02-28 04:28
(Received via mailing list)
Is it possible to define a model that is not backed by a database
table and still relate other models to it? Will relations between
instances of these models persist?

For instance, say I have a Cat model that does not inherit from
ActiveRecord and an Owner model that does. Can I assign a particular
cat to an owner? The next time I load the app will that pair be
Maurício L. (Guest)
on 2009-02-28 04:37
(Received via mailing list)

Unless you roll your own solution or persist the cat at the database
in a way or another.

Maurício Linhares (pt-br) |
This topic is locked and can not be replied to.