[LRUG] Field definitions in AR models

Nicholas Johnson me at nicholasjohnson.com
Thu Feb 26 04:01:48 PST 2015


It's historical. When Rails was first minted, you could hook it up to a
MySQL database, drop a scaffold tag in your view, and Rails would
dynamically compose the front end for you. One of the killer features was
that you could reorder the fields in your mySQL table using some GUI and
the forms would update automagically.

All that is long since gone, but the pattern remains, Rails will infer
model fields based on your DB schema.

On 25 February 2015 at 17:28, Rory Sinclair <rory at asmallworld.net> wrote:

> Enrique Riepenhausen did a really good talk on this subject at Scottish
> Ruby Conf in 2011.  He touched on this quite a bit, as well as the mindset
> we tend to get into 'translating' our customers language into CRUD
> operations we can do on AR objects, which is, he argues, a bit too
> low-level and not really modelling the domain at all.  It certainly stuck
> with me since, and i've tried to apply it to stuff I build (though i'm not
> dealing with AR directly every day these days).
>
> Here's the link, but unf. the video doesn't seem to be working at the
> moment, and I couldn't find a working one... :(
>
>
> http://confreaks.tv/videos/scotlandruby2011-don-t-build-another-tower-of-babel
>
> --
> Rory Sinclair
> Head of Technology
> ASMALLWORLD
>
> On Wednesday, 25 February 2015 at 16:51, Thomas Buckley-Houston wrote:
>
> Really interesting to hear the viewpoint that AR is just a persistence
> layer and not designed to define the domain model. It all makes a lot
> more sense now.
>
> @jc I'm interested in your idea about using accessors for each
> attribute, I'd like to try that. But yes, it's still not the single
> source of truth and so there's the risk of going out of sync with the
> DB.
>
> Anyway, lots to think about, much appreciated folks :)
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> Archives: http://lists.lrug.org/pipermail/chat-lrug.org
> Manage your subscription: http://lists.lrug.org/options.cgi/chat-lrug.org
> List info: http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> Archives: http://lists.lrug.org/pipermail/chat-lrug.org
> Manage your subscription: http://lists.lrug.org/options.cgi/chat-lrug.org
> List info: http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20150226/6122e6cb/attachment.html>


More information about the Chat mailing list