# Associating ActiveRecord and non-ActiveRecord objects

**URL:** <https://www.ruby-forum.com/t/associating-activerecord-and-non-activerecord-objects/161637>\
**Category:** Rails\
**Created:** [February 28, 2009, 3:28am UTC](https://www.ruby-forum.com/t/associating-activerecord-and-non-activerecord-objects/161637 "2009-02-28T03:28:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![evan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/54ee81/32.png) [@evan](https://www.ruby-forum.com/u/evan)\
**Post date:** [February 28, 2009, 3:28am UTC](https://www.ruby-forum.com/t/associating-activerecord-and-non-activerecord-objects/161637/1 "2009-02-28T03:28:14Z")

</div>

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  
remembered?

---

<div class="post-metadata">

**Author:** ![evan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/54ee81/32.png) [@evan](https://www.ruby-forum.com/u/evan)\
**Post date:** [February 28, 2009, 3:37am UTC](https://www.ruby-forum.com/t/associating-activerecord-and-non-activerecord-objects/161637/2 "2009-02-28T03:37:37Z")

</div>

No.

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

- 

Maurício Linhares  
[http://alinhavado.wordpress.com/](http://alinhavado.wordpress.com/) (pt-br) | [http://blog.codevader.com/](http://blog.codevader.com/)  
(en)
