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. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yeah something similar to that--it would be nice to also ''see'' the schema, for easy reference. On Feb 15, 8:11 pm, Mohit Sindhwani <mo_m...-RxrYI66vbj0AvxtiuMwx3w@public.gmane.org> wrote:> 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.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks! On Feb 15, 8:39 pm, Philip Hallstrom <r...-SUcgGwS4C16SUMMaM/qcSw@public.gmane.org> 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. > > 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) > # > # id :integer(11) not null > # quantity :integer(11) > # product_id :integer(11) > # unit_price :float > # order_id :integer(11) > # > > class LineItem < ActiveRecord::Base > belongs_to :product > > . . . > > Does not cope with models in sub-directories of app/models. > > Author: > Dave Thomas > Pragmatic Programmers, LLC > > Released under the same license as Ruby. No Support. No Warranty. > > Back up your model files before using... > > > > > 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.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 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) # # id :integer(11) not null # quantity :integer(11) # product_id :integer(11) # unit_price :float # order_id :integer(11) # class LineItem < ActiveRecord::Base belongs_to :product . . . Does not cope with models in sub-directories of app/models. Author: Dave Thomas Pragmatic Programmers, LLC Released under the same license as Ruby. No Support. No Warranty. Back up your model files before using...> > 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. > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---