+1.  I think making it a class method allows us to more easily expand the concept of system deployment (e.g.: multiple regions) later.  I am NOT trying to add this now, but would rather not be looking around for all find_by methods.

From: Victor Lowther [mailto:notifications@github.com]
Sent: Sunday, March 16, 2014 1:53 PM
To: opencrowbar/core
Cc: Hirschfeld, Rob
Subject: Re: [core] Goodbye, Snapshots. (#79)


In rails/app/models/deployment.rb:

>

> -  scope             :system_root,         -> { where(:system=>true) }   # cannot be named 'system' because of internal method name conflicts

Well, that would be an argument for making system (or system_root) a class method, then.

I understand DRY, but the modern incarnation of find_by is already fairly DRY by itself -- much more so than it was in Rails 2.x

—
Reply to this email directly or view it on GitHub<https://github.com/opencrowbar/core/pull/79/files#r10641283>.