Skip to content
This repository has been archived by the owner on Apr 27, 2019. It is now read-only.

sens3/delayed_paperclip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DelayedPaperclip

This plugin is for you if you want to load Paperclip processing off to Delayed_job

  • stores uploaded file to the given directory
  • enqueues an instance of the given Job class at the DJ job queue. Job instances are per default created with the object id only. If you need more you can overwrite the enqueue_new_job method in your model.

Of course, installation of both Paperclip and Delayed_job is required, duh!

Example


class Post
  has_attached_file :image
  delay_paperclip :tmp_dir => "#{RAILS_ROOT}/tmp/images", :job_class => 'PostJob'
end

The Job Class should look like this:


class PostJob < Struct.new(:post_id)
  def perform
    Post.find(self.post_id).perform    
  end
end

Copyright © 2009 Simon Baumgartner, released under the MIT license

About

to ease the use of paperclip with delayed_job

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages