On Wed, Nov 4, 2009 at 11:19 AM, MarkBennett <[email protected]>wrote:

>
> Right now I look in the db/schema.rb to see the list of fields
> associated with a model and assume that is where most other people
> look for these fields, which is why I wanted to put the descriptions
> there.  My thinking is that repeating this list of fields again in the
> code in app/models is unDRY because you've now got to maintain the
> same list of fields in both places.
>

Sure. My point should have been more that you *don't* maintain the schema.rb
file -- the migrations do.

When you say most developers don't regularly check the schema.rb, how
> do you know what a model's fields are without doing this?


I usually just type in the class name in my (already open) console window:

>> Account
=> Account<id: integer, created_at: datetime, updated_at: datetime,
full_domain: string, deleted_at: datetime, owner_id: integer>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" 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/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to