Skip to content
This repository
Browse code

Documenting the MD5 checksum fingerprint feature.

  • Loading branch information...
commit f815b8b329da6025852450ba45f15284d1ba52ec 1 parent 237597e
Mike Mondragon authored

Showing 1 changed file with 14 additions and 0 deletions. Show diff stats Hide diff stats

  1. 14  README.md
14  README.md
Source Rendered
@@ -231,6 +231,20 @@ Paperclip has an interpolation called `:hash` for obfuscating filenames of publi
231 231
 
232 232
 [https://github.com/thoughtbot/paperclip/pull/416](https://github.com/thoughtbot/paperclip/pull/416)
233 233
 
  234
+MD5 Checksum / Fingerprint
  235
+-------
  236
+A MD5 checksum of the original file assigned will be placed in the model if it has an attribute named fingerprint.  Following the user model migration example above, the migration would look like the following.
  237
+
  238
+    class AddAvatarFingerprintColumnToUser < ActiveRecord::Migration
  239
+      def self.up
  240
+        add_column :users, :avatar_fingerprint, :string
  241
+      end
  242
+
  243
+      def self.down
  244
+        remove_column :users, :avatar_fingerprint
  245
+      end
  246
+    end
  247
+
234 248
 Testing
235 249
 -------
236 250
 

0 notes on commit f815b8b

Please sign in to comment.
Something went wrong with that request. Please try again.