# File lib/paperclip/storage/fog.rb, line 77
      def flush_writes
        for style, file in @queued_for_write do
          log("saving #{path(style)}")
          retried = false
          begin
            directory.files.create(fog_file.merge(
              :body         => file,
              :key          => path(style),
              :public       => fog_public,
              :content_type => file.content_type.to_s.strip
            ))
          rescue Excon::Errors::NotFound
            raise if retried
            retried = true
            directory.save
            retry
          end
        end

        after_flush_writes # allows attachment to clean up temp files

        @queued_for_write = {}
      end