# Where/how to store a setting?

**URL:** <https://www.ruby-forum.com/t/where-how-to-store-a-setting/180378>\
**Category:** Rails\
**Created:** [December 18, 2009, 7:57pm UTC](https://www.ruby-forum.com/t/where-how-to-store-a-setting/180378 "2009-12-18T19:57:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [December 18, 2009, 7:57pm UTC](https://www.ruby-forum.com/t/where-how-to-store-a-setting/180378/1 "2009-12-18T19:57:58Z")

</div>

I have a task which queries the database and gets the relevant records  
from the last 5 days. I’d like to make that 5 a variable. Where/how  
would you recommend storing that data so that it can be accessed and  
changed and used ?  
A “Settings” database?

---

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [December 18, 2009, 8:13pm UTC](https://www.ruby-forum.com/t/where-how-to-store-a-setting/180378/2 "2009-12-18T20:13:46Z")

</div>

Aldric G. wrote:

> I have a task which queries the database and gets the relevant records  
> from the last 5 days. I’d like to make that 5 a variable. Where/how  
> would you recommend storing that data so that it can be accessed and  
> changed and used ?  
> A “Settings” database?

You don’t need a separate DB. Either a separate _table_ or a YAML  
config file (see the appropriate Railscast) would be my vote. Or store  
it in the class that does the querying.

Best,  
–Â  
Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalidÂ

---

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [December 18, 2009, 8:16pm UTC](https://www.ruby-forum.com/t/where-how-to-store-a-setting/180378/3 "2009-12-18T20:16:17Z")

</div>

Marnen Laibow-Koser wrote:

> Aldric G. wrote:
> 
> > Where/how  
> > would you recommend storing that data so that it can be accessed and  
> > changed and used ?  
> > A “Settings” database?
> 
> You don’t need a separate DB. Either a separate _table_ or a YAML  
> config file (see the appropriate Railscast) would be my vote. Or store  
> it in the class that does the querying.

Ugh, I -always- use the wrong word. I have to stop this. Thanks for the  
advice and options.
