Sha256: 6fbf78efbf91a376471d074bae0cf8ee4af4cf1298a5ff03538d3e3027716443

Contents?: true

Size: 788 Bytes

Versions: 3

Compression:

Stored size: 788 Bytes

Contents

module AttachmentMagick
  if AttachmentMagick.configuration.orms.include?("ActiveRecord")
    class ActiveRecordImage < ActiveRecord::Base
      self.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

3 entries across 3 versions & 1 rubygems

Version Path
attachment_magick-0.3.6 app/models/attachment_magick/active_record_image.rb
attachment_magick-0.3.5 app/models/attachment_magick/active_record_image.rb
attachment_magick-0.3.4 app/models/attachment_magick/active_record_image.rb