Ruby on Rails Monday, August 12, 2013

Thank you, Colin!

Colin Law wrote in post #1118501:
> Please remember to quote the previous message and insert your reply
> inline at appropriate points in the previous message. Remember this
> is a mailing list not a forum (though you may be accessing it using a
> forum-like interface). Thanks.

OK

> No you must not edit or delete an existing migration.

OK

>> the only thing i want to do is to add database field as a property to an
>> existing model by hands, without generating scaffold
>
> A migration is nothing to do with a scaffold. As I said just generate
> a new migration to add the database field. That is exactly what
> migrations are for.

I know.
But the model should contain database fields definitions.

> rails generate migration AddLgToUsers lg:string
>
> Which will even include the add_column for you, though you will have
> to add the default yourself before running the migration. Have a look
> at the rails guide on migrations.

I think I should try with an add_column expression.
Starting to search available online documentation.

> I guess that you are a beginner with rails and strongly recommend that
> you work right through a good tutorial such as railstutorial.org which
> will show you the basics of rails.
>
> Colin

Yes, I'm a beginner with rails and trying to understand how it works.
Although I do not much trust generated code and prefer hand-written, it
is possible it will work fine in special circumstances.

Valentin.

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/12711f052d0d12ae0bb9d520ccc359ad%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment