Why end with true?


From: Victor Lowther [mailto:notifications@github.com]
Sent: Saturday, October 12, 2013 10:50 AM Central Standard Time
To: crowbar/barclamp-crowbar <barclamp-crowbar@noreply.github.com>
Cc: Hirschfeld, Rob
Subject: Re: [barclamp-crowbar] Fix several Run-related race conditions [1/4] (#732)


In crowbar_framework/app/models/run.rb:

>      end
>    end
>
>    def self.empty?
>      cleanup
> -    Run.all.count == 0
> +    Run.transaction do


On Fri, Oct 11, 2013 at 9:58 PM, Rob Hirschfeld <notifications@github.com>wrote: In crowbar_framework/app/models/run.rb: > end > end > > def self.empty? > cleanup > - Run.all.count == 0 > + Run.transaction do this is a very nice ruby way to do the loop - it needs a comment since it may not be obvious to readers.
It is not a loop at all. :)
…
— Reply to this email directly or view it on GitHub<https://github.com/crowbar/barclamp-crowbar/pull/732/files#r6930430> .

—
Reply to this email directly or view it on GitHub<https://github.com/crowbar/barclamp-crowbar/pull/732/files#r6932064>.