I would love to see the properties available on that specific Ruby model
defined by annotations--much like relationship methods define what
relationships are available on any given model. But I do not believe that
this should flow backward into generation migrations.

If the model and the migration/database state can clearly had different
meaning/values (and it's incredibly obvious that they can especially in the
case of more than one app accessing the same database) it makes sense to
separate the idea of what attributes are available on the model from what
attributes are in the database.

It has the added benefit of making it easy to determine the properties to
which you have access while working on a model without needing to reference
the schema.

James Coleman

On Wed, May 9, 2012 at 2:21 PM, James B. Byrne <byrn...@harte-lyne.ca>wrote:

>
> On Wed, May 9, 2012 13:35, Maurizio Casimirri wrote:
>
> >
> > Migrations are meaningless outside active record (again the pattern
> > not the gem).. we can't enforce a migration centered approach in an
> > ORM agnostic environment.. perhaps to me it seems that is more
> > comfortable to make ActiveRecord to support properties inside models
> > that to ask Mongoid and other 500 ORMs around to dump fields and
> > support migrations.
>
> This statement is not factual.  Migrations, in the sense of being any
> systematic method of aggregating changes to a database schema over
> time and generating the necessary DDL, certainly can possess meaning
> outside of whatever method of data representation (AR, DM, IM, QO, ad
> nauseam) is chosen by an OO system designer.
>
> It is entirely conceivable that two or more separate projects
> employing AR (the pattern) could reference the same database and table
> and each consider only the subset of the schema necessary for their
> specific function.  In such a case, under your proposal, which
> implementation should provide the migration?
>
>
> --
> ***          E-Mail is NOT a SECURE channel          ***
> James B. Byrne                mailto:byrn...@harte-lyne.ca
> Harte & Lyne Limited          http://www.harte-lyne.ca
> 9 Brockley Drive              vox: +1 905 561 1241
> Hamilton, Ontario             fax: +1 905 561 0757
> Canada  L8E 3C3
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-core+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to