Created
February 6, 2011 01:44
-
-
Save gertig/813017 to your computer and use it in GitHub Desktop.
Rails 3 demo of using HTTParty and Moment for delayed jobs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#models/person.rb | |
class Person < ActiveRecord::Base | |
def self.create_schedule | |
@people = Person.find(:all) | |
time_increment = 1 #Starts the first scheduled task for 1 minute from now. | |
@people.each do |person| | |
schedule = Scheduler.new(person.id, time_increment) | |
pp schedule.schedule_it | |
time_increment = time_increment + 1 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment