Skip to content

Instantly share code, notes, and snippets.

@d11wtq
Created April 3, 2012 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d11wtq/2292109 to your computer and use it in GitHub Desktop.
Save d11wtq/2292109 to your computer and use it in GitHub Desktop.
/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'
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