Ideas for rails

Here are a few suggestions, wondering what others thought: When you generate a model for a DB table, it would be nice if the model.rb contained the DB schema (kind of like # commented out schema) right in the model file. This would make reference WAY easier and put all of the DB stuff in one easy file. Thanks.

also nice, of course, woudl be for rails to try and 'guess' the relationships among tables, and auto-generate the 'has_many' or 'belongs_to', if it is possible based on the syntax. Thanks.

rogerdpack wrote:

Here are a few suggestions, wondering what others thought: When you generate a model for a DB table, it would be nice if the model.rb contained the DB schema (kind of like # commented out schema) right in the model file. This would make reference WAY easier and put all of the DB stuff in one easy file. Thanks.

also nice, of course, woudl be for rails to try and 'guess' the relationships among tables, and auto-generate the 'has_many' or 'belongs_to', if it is possible based on the syntax. Thanks.

Would this help? http://magicmodels.rubyforge.org/

Cheers Mohit.

Yeah something similar to that--it would be nice to also 'see' the schema, for easy reference.

Here are a few suggestions, wondering what others thought: When you generate a model for a DB table, it would be nice if the model.rb contained the DB schema (kind of like # commented out schema) right in the model file. This would make reference WAY easier and put all of the DB stuff in one easy file. Thanks.

http://plugins.radrails.org/directory/show/12

From the readme...

Add a comment summarizing the current schema to the top of each ActiveRecord model source file:

   # Schema as of Sun Feb 26 21:58:32 CST 2006 (schema version 7)

thanks!