On 19 February 2011 19:39, Rushen Aly
<rushenaly-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi everybody,
>
> I am wondering whether there is a way to reflect all migrations to
> model file or not. I mean lets write a model generation command;
>
> rails generate model Justatry name:string
> name2:string .........
>
> after that lets run the rake db:migrate command. Finally if we look at
> the model file we just see;
>
> class Justatry < ActiveRecord::Base
> end
>
> I can not see any variable representing the columns which are
> attributes of our model. Is there any way to reflect these migrations
> to model file.
You can look in schema.rb. Also there is the annotate_models plugin
which will put the schema in the model file as comments.
Colin
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.