Created
April 3, 2012 13:43
-
-
Save d11wtq/2292109 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
/home/chris/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0/lib/dm-core/model/relationship.rb:372:in `method_missing' | |
/home/chris/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0/lib/dm-core/model/property.rb:249:in `method_missing' | |
/home/chris/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:514:in `load_missing_constant' | |
/home/chris/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:192:in `block in const_missing' | |
/home/chris/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:190:in `each' | |
/home/chris/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:190:in `const_missing' | |
/home/chris/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0/lib/dm-core/model.rb:728:in `const_missing' | |
/home/chris/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0/lib/dm-core/property/lookup.rb:25:in `const_missing' | |
/home/chris/flippa/flippa-rails/app/models/payment_agreement/credit_card.rb:43:in `process_payment' |
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 Post | |
include DataMapper::Resource | |
property :id, Serial | |
def self.do_some_in_background | |
all(:on_some_condition => true).each do |post| | |
# The problem arises when ClassUnderJobs (from app/job/class_under_jobs.rb) | |
# hasn't been expressly required. Usually Rails would auto-load it, but in | |
# this context DataMapper catches the const_missing() first and an exception | |
# is raised. | |
Resque.enqueue(ClassUnderJobs, :post_id => post.id) | |
end | |
end | |
end | |
Post.do_something_in_background |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment