Sha256: 481c9198a96c5c2bae18603654c0f65b268165c078ec58cc5f3b516c1087f3fb

Contents?: true

Size: 759 Bytes

Versions: 5

Compression:

Stored size: 759 Bytes

Contents

require 'paperclip'

Paperclip.interpolates :dav_root do |attachment, style|
  Droom.dav_root
end

Paperclip.interpolates :person do |attachment, style|
  attachment.instance.person_id
end

# Slug in this context will be the identifying string for either the group or the event
# to which our document_attachment is attached. If none is present, we use 'unattached'.
#
Paperclip.interpolates :slug do |attachment, style|
  attachment.instance.slug
end

Paperclip.interpolates :category do |attachment, style|
  attachment.instance.category
end

Paperclip.interpolates :category_and_slug do |attachment, style|
  fragment = attachment.instance.slug
  fragment = "#{fragment}/#{attachment.instance.category.slug}" if attachment.instance.category
  fragment
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
droom-0.4.3 config/initializers/paperclip.rb
droom-0.4.2 config/initializers/paperclip.rb
droom-0.4.1 config/initializers/paperclip.rb
droom-0.2.1 config/initializers/paperclip.rb
droom-0.0.1 config/initializers/paperclip.rb