See https://github.com/thoughtbot/paperclip/issues/1253 and https://github.com/thoughtbot/paperclip/commit/2aeb491fa79df886a39c35911603fad053a201c0 .