# Store limited list in db?

**URL:** <https://www.ruby-forum.com/t/store-limited-list-in-db/124613>\
**Category:** Rails\
**Created:** [December 31, 2007, 2:29am UTC](https://www.ruby-forum.com/t/store-limited-list-in-db/124613 "2007-12-31T02:29:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [December 31, 2007, 2:29am UTC](https://www.ruby-forum.com/t/store-limited-list-in-db/124613/1 "2007-12-31T02:29:46Z")

</div>

Hello,

I’m currently developing an application which contains a Movie object.  
I was wondering what the best way to store a limited list such as  
mpaa\_rating would be? The list is not likely to expand often, so i was  
wondering if it was still best to store this list in a table? Or if  
there was something else like acts\_as\_state\_machine for maintaining a  
simple list like this.

thanks!  
Adam

---

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [December 31, 2007, 2:32am UTC](https://www.ruby-forum.com/t/store-limited-list-in-db/124613/2 "2007-12-31T02:32:55Z")

</div>

You could store the rating as a constant in your config/environment.rb  
file:

MPAA\_RATINGS = [“Rating #1”,“Rating #2”]

And then just do a select in your form:

\<%= @film.select “rating”, MPAA\_RATINGS %\>

On Dec 31, 2007 11:59 AM, Adam W.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ## thanks! Adam
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.
