[Rails] how do set default value for ActiveRecord fields?

Kevin Olbrich
Tue, 01 Aug 2006 11:48:19 -0000

On Tuesday, August 01, 2006, at 1:26 PM, Chris wrote:
>Everytime a new record object is created i.e. Record.new, i want certain
>fields to be the same.
>
>Any idea how to do this?
>Thanks
>Chris
>
>--
>Posted via http://www.ruby-forum.com/.
>_______________________________________________
>Rails mailing list
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails

Easiest way would be to define :default=>some_value in the migration for
each column

t.column "title", :string, :default=>''test''

_Kevin
www.sciwerks.com

--
Posted with http://DevLists.com.  Sign up and save your mailbox.