Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b7d5e03c07
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (16 sloc) 0.541 kb
# this one uses the mysql2 gem as it has separate issues from mysql gem. One is that it doesn't work with rails 3.0.x!
require 'mysql2'
require 'active_record'
class Mysql2Worker < SimpleWorker::Base
attr_accessor :config
def connect(config)
ActiveRecord::Base.establish_connection(config['mysql'].merge!(:adapter=>'mysql2'))
end
merge "photo"
def run
connect(config)
photo = Photo.create!(:name=>"hi", :url=>"http://www.whatever.com")
photo = Photo.first
log "first photo=" + photo.inspect
end
end
Jump to Line
Something went wrong with that request. Please try again.