Skip to content

Commit

Permalink
ActiveRecord::SecureRandom has been deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
mnzaki committed Aug 16, 2012
1 parent a5f7ac8 commit cbbc547
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 @@ -79,7 +79,7 @@ def self.distribute_to_nodes
# Reserves all available WorkUnits for this process. Returns false if there
# were none available.
def self.reserve_available(options={})
reservation = ActiveSupport::SecureRandom.random_number(MAX_RESERVATION)
reservation = SecureRandom.random_number(MAX_RESERVATION)
conditions = "reservation is null and node_record_id is null and status in (#{INCOMPLETE.join(',')}) and #{options[:conditions]}"
any = WorkUnit.update_all("reservation = #{reservation}", conditions, options) > 0
any && reservation
Expand Down

0 comments on commit cbbc547

Please sign in to comment.