# Model attributes that are not backed by persistent storage

**URL:** <https://www.ruby-forum.com/t/model-attributes-that-are-not-backed-by-persistent-storage/89434>\
**Category:** Rails\
**Created:** [March 28, 2006, 9:34pm UTC](https://www.ruby-forum.com/t/model-attributes-that-are-not-backed-by-persistent-storage/89434 "2006-03-28T21:34:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 28, 2006, 9:34pm UTC](https://www.ruby-forum.com/t/model-attributes-that-are-not-backed-by-persistent-storage/89434/1 "2006-03-28T21:34:09Z")

</div>

I have a model object that I would like to add an attribute to.

It’s an array of other objects.

If I do

attr\_accessor :local\_image\_tags

should I then be able to assign to object.local\_image\_tags or read from  
object.local\_image\_tags without incident?

Is ActiveRecord going to assume that there is a table behind these guys?  
If so, how do I indicate that these attributes are not stored?

Thanks,  
Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 28, 2006, 10:35pm UTC](https://www.ruby-forum.com/t/model-attributes-that-are-not-backed-by-persistent-storage/89434/2 "2006-03-28T22:35:58Z")

</div>

On Tue, Mar 28, 2006 at 09:34:09PM +0200, Wes G. wrote:

> Is ActiveRecord going to assume that there is a table behind these guys?

No. ActiveRecord _knows_ what fields are in the table that underlies  
the  
object, it doesn’t need to assume anything. Besides, the mechanics of  
attributes-as-fields is completely different to attr\_accessors.

> If so, how do I indicate that these attributes are not stored?

You don’t. AR knows all about the table and it’s structure, and will  
ignore  
any new and shiny instance attributes you may care to play with.

- Matt
