# Default values for table

**URL:** <https://www.ruby-forum.com/t/default-values-for-table/113186>\
**Category:** Rails\
**Created:** [August 28, 2007, 2:31pm UTC](https://www.ruby-forum.com/t/default-values-for-table/113186 "2007-08-28T14:31:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eggie5](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7c8e57/32.png) [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Post date:** [August 28, 2007, 2:31pm UTC](https://www.ruby-forum.com/t/default-values-for-table/113186/1 "2007-08-28T14:31:10Z")

</div>

I have a table called subscriptions with it’s respective model  
Subscription.

Anytime I create a new entry for this table I would like to have a few  
default values set automatically for the columns: timestamp\_start and  
is\_subscribed. timestamp\_start should default to Time.now.to\_s and  
is\_subscribed should default to true.

How can I facilitate this in rails short of specifying these values  
manually myself each time i create a new Subscription istance?

---

<div class="post-metadata">

**Author:** ![eggie5](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7c8e57/32.png) [@eggie5](https://www.ruby-forum.com/u/eggie5)\
**Post date:** [August 28, 2007, 5:34pm UTC](https://www.ruby-forum.com/t/default-values-for-table/113186/2 "2007-08-28T17:34:35Z")

</div>

try this:

[http://agilewebdevelopment.com/plugins/default\_value](http://agilewebdevelopment.com/plugins/default_value)
