Skip to content

Commit

Permalink
Passing 'conditions' to update_all method in the right parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecvo committed Jul 30, 2010
1 parent 5bbe8c6 commit 003c1bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cloud_crowd/models/work_unit.rb
Expand Up @@ -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

Expand Down

0 comments on commit 003c1bb

Please sign in to comment.