Repository is archived
No commit activity in last 3 years
No release in over 3 years
This gem adds a mixin allowing you to forgo uploading a replacement Paperclip attachment if it's identical to the current attachment.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 5.0
>= 0
>= 0

Runtime

 Project Readme

Paperclip Duplicate Checker

Author Tim Morgan
Version 1.0 (Apr 20, 2012)
License Released under the MIT license.

This class extends Paperclip, adding a feature that forgoes uploading a replacement for an existing attachment file if the replacement is identical to the existing file.

In order for this to work, your model _must_have an <attachment>_fingerprint column, since MD5 fingerprints are used for comparison. To use, simply follow this example:

class MyModel < ActiveRecord::Base
  include CheckForDuplicateAttachedFile
  has_attachment :note
  check_for_duplicate_attached_file :note
end

Et voila! You save on bandwidth costs if your code re-uploads a lot of the same files.