Sha256: 8a0cff68d633c7c783c347a59216332c22eb53c5b914d09ef4228de0d24cf643

Contents?: true

Size: 784 Bytes

Versions: 1

Compression:

Stored size: 784 Bytes

Contents

module AttachmentMagick
  if AttachmentMagick.configuration.orms.include?("ActiveRecord")
    class ActiveRecordImage < ActiveRecord::Base
      set_table_name "amagick_images"

      belongs_to      :imageable, :polymorphic => true
      image_accessor  :photo

      attr_accessor :file_name #not implemented yet

      auto_html_for :source => "_to_html" do
        youtube(:width => 620, :height => 465)
        vimeo(:width => 620, :height => 465)
      end

      auto_html_for :source => "_to_image" do
        youtube_image
        vimeo_image(:size => :large)
      end

      #not implemented yet
      def is_flash?
        false
      end
    end
  else
    #mongoid hack
    #mongoid v2.3 tries to read all the models =/  
    class ActiveRecordImage
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
attachment_magick-0.3.3 app/models/attachment_magick/active_record_image.rb