Skip to content

Instantly share code, notes, and snippets.

@lucascaton
Created July 8, 2011 03:10
Show Gist options
  • Save lucascaton/1071046 to your computer and use it in GitHub Desktop.
Save lucascaton/1071046 to your computer and use it in GitHub Desktop.
resque.rake
require 'resque/tasks'
require 'active_record'
env = ENV["RAILS_ENV"] || 'development'
database_config = YAML::load(File.open('config/database.yml'))
connection = ActiveRecord::Base.establish_connection(database_config[env])
files = ['lib/foo', 'lib/bar', 'app/models/foo', 'app/workers/foo']
files.each { |file| require file }
task 'resque:setup'
@lucascaton
Copy link
Author

Agradeça ao Baggio :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment