Skip to content

Instantly share code, notes, and snippets.

?> Rating.count
=> 80371
>> r = Rating.find(26)
=> #<Rating id: 26, value: 3, user_id: 1089, rateable_id: 46, rateable_type: "Entry", created_at: "2008-10-23 01:51:38", updated_at: "2008-10-23 01:51:38", category: "completeness", certified: true>
>> r.save
=> true
>> r = Rating.find(26)
ActiveRecord::RecordNotFound: Couldn't find Rating with ID=26
from /usr/local/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:1379:in `find_one'
from /usr/local/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:1362:in `find_from_ids'
Settings.voting_begin = Time.now.to_s
Competition.setup!
def doit(iterations = 10)
total_time = 0.0
count = 0
iterations.times do
entry = Entry.find(:first, :order => 'RAND()')
user = User.find(:first, :order => 'RAND()')
user.can_rate(entry)
ratings = {
# Note: under the shared directory, have a config subdir with the database.yml file in it.
default_run_options[:pty] = true
set :application, ""
set :deploy_to, "/var/www/apps/#{application}"
set :scm, :git
set :repository, "[email protected]:railsrumble/#{application}.git"
set :branch, "master"
set :deploy_via, :remote_cache