jrgifford / delayed_paperclip

Process your Paperclip attachments in the background with delayed_job or Resque.
http://www.jstorimer.com/ruby/2010/01/30/delayed-paperclip.html
MIT License
402 stars 155 forks source link

fog_public always defaults to true in delayed_job background #97

Open rsiddle opened 10 years ago

rsiddle commented 10 years ago

There appears to be an issue where the fog_public option is not maintained in the delayed background. I'm overriding the fog_public method and it's just hitting the 'true' response each time.

module Paperclip
  module Storage
    module Fog
      def fog_public(style = default_style)
        if @options.has_key?(:fog_public)
          if @options[:fog_public].respond_to?(:has_key?) && @options[:fog_public].has_key?(style)
            @options[:fog_public][style]
          else
            @options[:fog_public]
          end
        else
          # Always hits here with a delayed_job instance. It's not calling the attachment instance?
          true
        end
      end
   end
end
ScotterC commented 9 years ago

Thanks for the issue @rsiddle. If this happens only when using Delayed Paperclip, can you give me the Paperclip and Delayed Paperclip versions please?