Clearly this isn't the ActiveRecord approach, where what is in the table is
the authoritative view.  If you want to use ActiveRecord in a style where
the models contain the authoritative view, check out the third-party
library HoboFields:

http://cookbook.hobocentral.net/manual/hobo_fields

It gives you a DSL to specify the attributes on a model, and will
automatically generate database migrations to make your database reflect
this state.

-Andrew.


On Tue, May 8, 2012 at 8:38 AM, Tim Shaffer <[email protected]> wrote:

> Seems like unnecessary duplication if you have to specify the field in a
> migration as well as in the model itself.
>
> What's the point of having to specify the field on the model if it's
> already in the table? Unless there is some other benefit that I am not
> seeing right away.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-core/-/H3ZxWdejlX8J.
>
> 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.
>



-- 
Andrew Mutz
Director of Software Engineering
AppFolio, Inc.

55 Castilian Dr. | Goleta, CA | 93117
Phone: 805.617.2167 | Fax: 805.968.0646
[email protected]
www.appfolio.com
-------------------------------------------------------------------------------------
"Web-Based Property Management Software Made Easy."

-- 
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.

Reply via email to