Many moons ago, Dr Nic released 'Magic Model Generator' for a similar use 
case: http://magicmodels.rubyforge.org/magic_model_generator/ - 
unfortunately it's years out of date.

A more recent alternative is the 'Rails Models Reverse Engineering' 
gem: https://github.com/bosko/rmre

On Thursday, October 10, 2013 12:17:48 PM UTC+11, Lyndon Maydwell wrote:
>
> Hi RORO.
>
>
> I'm wondering if there's a good way to dump existing model information in 
> a format that can be used by `rails g`. For example, something like:
>
> ```
> > rake db:dumpgenerator
> rails generate model user name:string
> rails generate model post title:string body:text published:boolean 
> user:references
> rails generate model comment body:string post:references
> ```
>
> This way I could recreate my models from another project quickly without 
> having to deal with the migration cruft that has accumulated over time by 
> using something like:
>
> `mynewproject $ (cd otherproject && rake db:dumpgenerator) | sh`
>
> Maybe there's another preferred way to do this that I'm not aware of?
>
>
> Thanks!
>
>
>  - Lyndon
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rails-oceania+unsubscr...@googlegroups.com.
To post to this group, send email to rails-oceania@googlegroups.com.
Visit this group at http://groups.google.com/group/rails-oceania.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to