Scaffolding and ActiveRecord in Rails 2

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.

I don’t think so. But you can edit the migration file that the scaffold
generator produces before running rake db:migrate.

Roy P. 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. :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs