[LRUG] Field definitions in AR models
Alex Tomlins
alex at tomlins.org.uk
Wed Feb 18 04:10:14 PST 2015
Doh! I fail at reading. Sorry about the noise...
Alex
On 17/02/2015 16:53, Alex Tomlins wrote:
> In the past I've used the annotate gem[1] to maintain comments at the
> top of model files. The readme[2] has examples of what they look like.
>
> thanks,
> Alex
>
> [1] https://rubygems.org/gems/annotate
> [2] https://github.com/ctran/annotate_models#readme
>
> On 17/02/2015 10:43, Thomas Buckley-Houston wrote:
>> Hello,
>>
>> This is a musing more than anything.
>>
>> Having used Mongoid on most projects over the last few years it's come
>> as a bit of shock to be working on an Activerecord project. The main
>> reason being the lack of field definitions in model classes. I've
>> realised how much I've come to depend on looking at the models to
>> navigate the territory of the project's domain. Instead I'm constantly
>> scrolling through `schema.rb'. I know there's the annotate_models gem,
>> but it's not the same. Neither the schema file nor the annotate gem
>> allow you to comment against a particular field to explain its
>> significance.
>>
>> What's the history of this pattern? Surely model properties are key to
>> the MVC philosophy? And what does everyone else do about it? Is there
>> a way of using attr_accessor or some such to get what I want?
>>
>>
>> Thanks,
>> tom :)
>> _______________________________________________
>> 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
>
--
Alex Tomlins
Email: alex at tomlins.org.uk
There are two kinds of people in the world: those who finish what they started
More information about the Chat
mailing list