Sha256: 37aa1bd6851f0fa405f76bc2bd6bffb5eaedbda2ece039dd876603947291ac15

Contents?: true

Size: 544 Bytes

Versions: 10

Compression:

Stored size: 544 Bytes

Contents

class Attachment < ActiveRecord::Base
  
  include ::Paperclip
  include ::Paperclip::Glue

  has_attached_file :attach,
      :path  => "#{ActiveMetadata::CONFIG['attachment_base_path']}/:document_id/:label/:id/:basename.:extension",
      :url  => "#{ActiveMetadata::CONFIG['attachment_base_url']}/:document_id/:label/:id/:basename.:extension"

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

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

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
active_metadata-0.4.1 lib/model/active_record/attachment.rb
active_metadata-0.3.2 lib/model/active_record/attachment.rb
active_metadata-0.3.1 lib/model/active_record/attachment.rb
active_metadata-0.3.0 lib/model/active_record/attachment.rb
active_metadata-0.2.4 lib/model/active_record/attachment.rb
active_metadata-0.2.3 lib/model/active_record/attachment.rb
active_metadata-0.2.2 lib/model/active_record/attachment.rb
active_metadata-0.2.1 lib/model/active_record/attachment.rb
active_metadata-0.2.0 lib/model/active_record/attachment.rb
active_metadata-0.1.9 lib/model/active_record/attachment.rb