# Models with only one entry

**URL:** <https://www.ruby-forum.com/t/models-with-only-one-entry/121410>\
**Category:** Rails\
**Created:** [November 27, 2007, 7:18pm UTC](https://www.ruby-forum.com/t/models-with-only-one-entry/121410 "2007-11-27T19:18:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkanders](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7bcc69/32.png) [@dkanders](https://www.ruby-forum.com/u/dkanders)\
**Post date:** [November 27, 2007, 7:18pm UTC](https://www.ruby-forum.com/t/models-with-only-one-entry/121410/1 "2007-11-27T19:18:53Z")

</div>

Are there any sweet rails conventions for dealing with models that only  
have one entry in a table?

Here are the specifics of my application…

I have 3 manageable content areas on a website (3 different pages with  
static content that can be edited by a site administrator).

I am creating a “Portal” model that I’m going to subclass a different  
model off of for each manageable content areas (“home\_portal”,  
“designer\_portal”, and “store\_portal”) and use single table inheritance.  
So, the home\_portal, designer\_portal, and store\_portal will all inherit  
from the portals table.

The table is really simple, it just has a “main content area” field and  
the home\_portal will use the “caption field” as well, but I’m going to  
set attr\_accessible on each model so they can only access the fields  
that are pertinent to those pages.

Anyway, there is only going to be one entry for each model. Since there  
is only one home\_portal, one designer\_portal, and one store\_portal, I’m  
only going to need one entry for each.

I’m wondering if there are any sweet ways of dealing with the single  
entry for the models? Thanks in advance, I hope this post isn’t  
confusing, if it is, just ask me for more info… Dustin
