Skip to content

Commit

Permalink
force styles generation, since we aren't in the normal paperclip path
Browse files Browse the repository at this point in the history
we are unsetting the attachment_s3_key to avoid an infinite loop, because after the call to reprocess! the object will be saved and the after save will be called, calling the reporcess! again, and this variable is the guard to call the callback.
  • Loading branch information
Carlos Eduardo Rodrigues Diógenes committed Feb 1, 2015
1 parent c23adb3 commit 96a3bc9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/s3-upnow/paperclip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def has_attached_file(name, options = {})
dest_bucket = s3.buckets[s3_upnow_destination_bucket(name)]
dest_object = dest_bucket.objects[s3_upnow_destination_path(name)]
dest_object.copy_from(orig_object, acl: s3_upnow_destination_permissions(name))
remove_instance_variable("@#{name}_s3_key")
s3_upnow_attachment(name).reprocess!
end
end
super(name, options)
Expand Down

0 comments on commit 96a3bc9

Please sign in to comment.