# Best way to do default values

**URL:** <https://www.ruby-forum.com/t/best-way-to-do-default-values/144533>\
**Category:** Rails\
**Created:** [July 30, 2008, 7:02pm UTC](https://www.ruby-forum.com/t/best-way-to-do-default-values/144533 "2008-07-30T19:02:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![asoto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/58956e/32.png) [@asoto](https://www.ruby-forum.com/u/asoto)\
**Post date:** [July 30, 2008, 7:02pm UTC](https://www.ruby-forum.com/t/best-way-to-do-default-values/144533/1 "2008-07-30T19:02:47Z")

</div>

I’m working on a Role-based user authentication model, where a user  
habtm roles, and roles habtm rights. My problem is that I know that I  
need specific Role instances right off the bat, so how do i go about  
ensuring they’re in the system. I know I could do this in a migration,  
but it doesn’t seem like the right approach, as it’s a bit constrictive.

I’ve also thought of defining class variables with the default values.  
Anyone have any thoughts/experience doing something similar?
