Long story short: I''ve been looking at Grails and noticed their models contain both the schema information as well as the normal validation, constraint information. Does doing it that way pose some serious deficiencies? I find that I get confused with schemas being in an entirely different location than the constraints and validation of them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It is the way it is. :) Well that''s not very helpful at all, is it? In all seriousness, the main thing you should realize is that a model in Rails looks at an existing table and builds methods to access the columns in your table. You don''t need a migration / schema to have a model. Migrations in Rails are there to build the database for you but once that''s done, nothing in Rails ever looks at them again. They''re more of a utility than anything else. Other ORM libraries, notably DataMapper, take an approach similar to the one you describe in Grails. ActiveRecord, however, prefers minimal configuration. Also, you might be interested to know that Migrations were not introduced until Rails 1.1. If you get confused, there''s a wonderful plugin called annotate_models that I use on all my projects. It puts the schema info as comments in your models and fxtures so you have them as a reference as well as in your docs. On Tue, Aug 26, 2008 at 4:27 PM, klauer <Klauer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Long story short: I''ve been looking at Grails and noticed their models > contain both the schema information as well as the normal validation, > constraint information. > > Does doing it that way pose some serious deficiencies? I find that I > get confused with schemas being in an entirely different location than > the constraints and validation of them. > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''ll definitely be checking out the annotate_models plugin. I remember briefly looking at DataMapper, but I haven''t tried doing anything in it. Thank you very much. :) On Aug 26, 5:46 pm, "Brian Hogan" <bpho...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It is the way it is. :) > > Well that''s not very helpful at all, is it? In all seriousness, the main > thing you should realize is that a model in Rails looks at an existing table > and builds methods to access the columns in your table. You don''t need a > migration / schema to have a model. > > Migrations in Rails are there to build the database for you but once that''s > done, nothing in Rails ever looks at them again. They''re more of a utility > than anything else. > > Other ORM libraries, notably DataMapper, take an approach similar to the one > you describe in Grails. ActiveRecord, however, prefers minimal > configuration. Also, you might be interested to know that Migrations were > not introduced until Rails 1.1. > > If you get confused, there''s a wonderful plugin called annotate_models that > I use on all my projects. It puts the schema info as comments in your models > and fxtures so you have them as a reference as well as in your docs. > > On Tue, Aug 26, 2008 at 4:27 PM, klauer <Kla...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Long story short: I''ve been looking at Grails and noticed their models > > contain both the schema information as well as the normal validation, > > constraint information. > > > Does doing it that way pose some serious deficiencies? I find that I > > get confused with schemas being in an entirely different location than > > the constraints and validation of them.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---