about summary refs log tree commit diff
path: root/lib/paperclip/attachment_extensions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/paperclip/attachment_extensions.rb')
-rw-r--r--lib/paperclip/attachment_extensions.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/paperclip/attachment_extensions.rb b/lib/paperclip/attachment_extensions.rb
index ce5780557..f3e51dbd3 100644
--- a/lib/paperclip/attachment_extensions.rb
+++ b/lib/paperclip/attachment_extensions.rb
@@ -14,6 +14,15 @@ module Paperclip
       end
     end
 
+    def storage_schema_version
+      instance_read(:storage_schema_version) || 0
+    end
+
+    def assign_attributes
+      super
+      instance_write(:storage_schema_version, 1)
+    end
+
     def variant?(other_filename)
       return true  if original_filename == other_filename
       return false if original_filename.nil?