07 May '13, 1am

Latest post on leaky ActiveRecord applications

Extending ActiveRecord::Base leaks a powerful API throughout an application which can lead to tempting code which breaks good design. Take the classic blog example where you may want to retrieve the latest posts by a given author. You may have seen, or even written code that gets the dataset you need straight into the controller or view: Post.where(author_id: author_id).limit(20).order("created_at DESC").each { ... } For me this is a design violation as well as breaking the “Law of Demeter” . The example above tells me structure of the schema that the calling class has no business knowing. It also makes testing using stubs ugly and encourages testing against the database directly. A test would have to chain three methods to stub a return value. It’s brittle, as in it’s susceptible to breaking due to changes outside of the class. For me it also fails from a narrative perspe...

Full article: http://pivotallabs.com/stop-leaking-activerecord/

Tweets

Tagging With ActiveRecord and Postgres

rubyflow.com 07 May '13, 3am

Tagging With ActiveRecord and Postgres Posted by netghost on May 07, 2013 — 0 comments Take a look at how to implement Tag...

Carney(D) now blaming Republicans for "leaking"...

ace.mu.nu 10 May '13, 8pm

Holy Crap: HHS Secretary Sebilus Is Extorting Money From Health Care Industry To Promote ObamaCare » May 10, 2013 Jay Carn...

May application phase to open for #Sailors seek...

navy.mil 06 May '13, 8pm

MILLINGTON, Tenn. (NNS) -- The Career Management System Interactive Detailing (CMS/ID) application phase is scheduled to b...

Procrastination, considered. via @pivotallabs

pivotallabs.com 05 May '13, 9pm

Last week I blogged about a new project for aiding in the hunt for test pollution, Scrubber . This is a personal side proj...