From 003c1bb98329028fbe6129e8a003833f8f9afd1c Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Date: Fri, 30 Jul 2010 14:13:44 -0300 Subject: [PATCH] Passing 'conditions' to update_all method in the right parameter --- lib/cloud_crowd/models/work_unit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cloud_crowd/models/work_unit.rb b/lib/cloud_crowd/models/work_unit.rb index a3a2197..b6578ba 100644 --- a/lib/cloud_crowd/models/work_unit.rb +++ b/lib/cloud_crowd/models/work_unit.rb @@ -69,7 +69,7 @@ def self.distribute_to_nodes # were none available. def self.reserve_available(options={}) reservation = ActiveSupport::SecureRandom.random_number(MAX_RESERVATION) - any = WorkUnit.available.update_all("reservation = #{reservation}", nil, options) > 0 + any = WorkUnit.available.update_all("reservation = #{reservation}", options[:conditions], options) > 0 any && reservation end