Em 09-05-2012 15:46, James Coleman escreveu:
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.
So, if I understand correctly, the proposal would be to just add some
annotation method to make it explicit which columns our model cares
about using a common API so that other gem authors could use that
information for doing something meaningful.
If that is the proposal, I'd vote for it. The annotations would only
store the relevant column names so that they can be queried by
third-party gems and would bring a documentation of available/relevant
fields of the model as a side effect.
Nice :)
Good luck on trying to convince the core members about this idea :)
Cheers,
Rodrigo.
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.