Scaffolding and ActiveRecord in Rails 2

0 views
Skip to first unread message

David B.

unread,
May 21, 2008, 7:56:24 AM5/21/08
to rubyonra...@googlegroups.com
Hi,

Is is possible to add this constraint: "null => false" and "limit => 45"
like below:

create_table :movie do |t|
t.string :name, :null => false, :limit => 45
end

...just by using this kind of scaffold command (on Rails 2)?

$ ruby script/generate scaffold Movie name:string

Thanks,

D.
--
Posted via http://www.ruby-forum.com/.

Pardee, Roy

unread,
May 21, 2008, 8:59:06 AM5/21/08
to rubyonra...@googlegroups.com
I don't think so. But you can edit the migration file that the scaffold
generator produces before running rake db:migrate.

David B.

unread,
May 21, 2008, 9:12:12 AM5/21/08
to rubyonra...@googlegroups.com
Roy Pardee wrote:
> I don't think so. But you can edit the migration file that the scaffold
> generator produces before running rake db:migrate.

Okay, thank you. :)

Reply all
Reply to author
Forward
0 new messages