fesplugas/typus — pull request #319 by timbica (2011-11-25 19:14:11+00:00)
Title: Fix problem when running the typus generator without a database created

This fix complements the fix you did regarding the comments of user gamafranco in https://github.com/fesplugas/typus/commit/14cf7cd301d09e41f95ee043e4d38a71a3e0464e#lib/generators/typus/config_generator.rb-P39

In my company we use a Rails template called Maven-Warrior (https://github.com/imaginary-cloud/Maven-Warrior).
In the template we run the typus generator without any table created (using a MySQL database configuration).
When the generator tries to create the YAML configuration files for the existing models (in this case we already have a User model created by Devise) we get an error telling that we don't have a connection to the database.
My push checks if a database connection exists!

Note: I don't know if it is good to include the "to_label" field in the defaults - why is that done?