Sha256: 0668dec54b09114d2348fa78861e4e62a02252d9a43a6462837a6bbff176b345

Contents?: true

Size: 655 Bytes

Versions: 3

Compression:

Stored size: 655 Bytes

Contents

module Annotator
  module InitialDescription

    # Initial descriptinos for paperclip attachments columns
    class Paperclip < Base

      def check
        if @model.respond_to?(:attachment_definitions) && @model.attachment_definitions
          @model.attachment_definitions.keys.each do |att|
            cols = ["#{att}_file_name", "#{att}_content_type", "#{att}_file_size", "#{att}_updated_at"]
            if cols.include? @column
              @attachment = att
              return true 
            end
          end
        end
        return false
      end

      def text
        "Paperclip for #{@attachment}"
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
annotator-0.0.10 lib/annotator/initial_description/paperclip.rb
annotator-0.0.9 lib/annotator/initial_description/paperclip.rb
annotator-0.0.8.1 lib/annotator/initial_description/paperclip.rb