Last active
August 29, 2015 14:05
-
-
Save advorak/8bb60de5071d9756e167 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Person < ActiveRecord::Base | |
include Backburner::Performable | |
queue_priority 500 | |
def self.make_person(name, options = {}) | |
self.create name: name, guid: options[:guid] | |
end | |
def self.work | |
Backburner.work('person-jobs','backburner-jobs','person') | |
end | |
end |
This file contains hidden or 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
# I am running a separate task in the console by running: Person.work | |
# When I make a person, the guid field gets transmitted... | |
Person.make_person 'Andy', guid: '12345' | |
Person.last #=> #<Person id: 6, name: "Andy", guid: "12345", created_at: "2014-08-27 09:26:15", updated_at: "2014-08-27 09:26:15"> | |
# PROBLEM: When I use Person.async, the guid field is not transmitted -- only the first item... | |
Person.async.make_person('Andy', {guid: 'test'}) | |
Person.last #=> #<Person id: 8, name: "Andy", guid: nil, created_at: "2014-08-27 09:31:37", updated_at: "2014-08-27 09:31:37"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment