require "paperclip/storage/dropbox/private_url_generator"
require "paperclip/storage/dropbox/public_url_generator"
module Paperclip
  module Storage
    module Dropbox
      module GeneratorFactory
        def self.build_url_generator(storage, options)
          if options[:dropbox_credentials][:access_type] == "app_folder" || options[:dropbox_visibility] == "private"
            PrivateUrlGenerator.new(storage, options)
          elsif options[:dropbox_credentials][:access_type]
            PublicUrlGenerator.new(storage, options)
          end
        end
      end
    end
  end
end


require "paperclip/storage/dropbox/private_url_generator"
require "paperclip/storage/dropbox/public_url_generator"
module Paperclip
  module Storage
    module Dropbox
      module GeneratorFactory
        def self.build_url_generator(storage, options)
          if options[:dropbox_credentials][:access_type] == "app_folder" || options[:dropbox_visibility] == "private"
            PrivateUrlGenerator.new(storage, options)
          elsif options[:dropbox_credentials][:access_type] == "dropbox"
            PublicUrlGenerator.new(storage, options)
          end
        end
      end
    end
  end
end


--- 
+++ 
@@ -7,7 +7,7 @@
         def self.build_url_generator(storage, options)
           if options[:dropbox_credentials][:access_type] == "app_folder" || options[:dropbox_visibility] == "private"
             PrivateUrlGenerator.new(storage, options)
-          elsif options[:dropbox_credentials][:access_type] == "dropbox"
+          elsif options[:dropbox_credentials][:access_type]
             PublicUrlGenerator.new(storage, options)
           end
         end
Fix "undefined method `generate' for nil:NilClass"

Fixes #45
