Sha256: cf1b9ce4dd8c3423774b4bf530d229c5b88314139a88f32a8f5699fadf1b0411

Contents?: true

Size: 1.26 KB

Versions: 24

Compression:

Stored size: 1.26 KB

Contents

module Paperclip
  class Attachment
    def self.default_options
      #Credit http://www.jonathanspies.com/posts/6-Using-yaml-to-configure-default-options-for-Paperclip
      # look for paperclip environment overrides in paperclip.yml
      return @default_options if @default_options

      @default_options = {
        :url                   => "/system/:attachment/:id/:style/:filename",
        :path                  => ":rails_root/public:url",
        :styles                => {},
        :only_process          => [],
        :processors            => [:thumbnail],
        :convert_options       => {},
        :default_url           => "/:attachment/:style/missing.png",
        :default_style         => :original,
        :storage               => :filesystem,
        :use_timestamp         => true,
        :use_default_time_zone => true,
        :hash_digest           => "SHA1",
        :hash_data             => ":class/:attachment/:id/:style/:updated_at",
        :preserve_files        => false
      }

      if defined?(::Rails.root.to_s) and File.exists?("#{::Rails.root.to_s}/config/paperclip.yml")
        @default_options.merge!(YAML.load_file("#{::Rails.root.to_s}/config/paperclip.yml")[RAILS_ENV].symbolize_keys) rescue nil
      end
      
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
soapbox-0.3.1 lib/soapbox/paperclip.rb
soapbox-0.3.0 lib/soapbox/paperclip.rb
soapbox-0.2.24 lib/soapbox/paperclip.rb
soapbox-0.2.23 lib/soapbox/paperclip.rb
soapbox-0.2.21 lib/soapbox/paperclip.rb
soapbox-0.2.20 lib/soapbox/paperclip.rb
soapbox-0.2.18 lib/soapbox/paperclip.rb
soapbox-0.2.16 lib/soapbox/paperclip.rb
soapbox-0.2.15 lib/soapbox/paperclip.rb
soapbox-0.2.14 lib/soapbox/paperclip.rb
soapbox-0.2.12 lib/soapbox/paperclip.rb
soapbox-0.2.11 lib/soapbox/paperclip.rb
soapbox-0.2.10 lib/soapbox/paperclip.rb
soapbox-0.2.9 lib/soapbox/paperclip.rb
soapbox-0.2.8 lib/soapbox/paperclip.rb
soapbox-0.2.7 lib/soapbox/paperclip.rb
soapbox-0.2.6 lib/soapbox/paperclip.rb
soapbox-0.2.5 lib/soapbox/paperclip.rb
soapbox-0.2.4 lib/soapbox/paperclip.rb
soapbox-0.2.3 lib/soapbox/paperclip.rb