Skip to content

Instantly share code, notes, and snippets.

Created October 15, 2012 17:18
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 anonymous/3893737 to your computer and use it in GitHub Desktop.
Save anonymous/3893737 to your computer and use it in GitHub Desktop.
module Easypaste
class Paste
include DataMapper::Resource
property :id, Serial
property :text, Text
def async_archive
Resque.enqueue(Archive, self.id)
end
def get_content
# Something
end
end
class Archive
@queue = :paste_archive
def self.perform(paste_id)
paste = Paste.get(paste_id)
paste.get_content
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment