Sha256: 1ae515a4d8585ae899cc705eabed4afc8d0cf7b0aa195d190ee14fa09d222b03

Contents?: true

Size: 827 Bytes

Versions: 27

Compression:

Stored size: 827 Bytes

Contents

module Alchemy::Custom::Model::ElFinder
  module Paths
    class Image < Paths::File

      #
      # url per la thumb
      def tmb
        active_record_instance.image_file.thumb('100x100#').url
      end

      def full_fill_paylod(payload)
        payload[:tmb] = self.tmb
        payload[:original_url] = active_record_instance.image_file.url
        payload
      end

      def active_record_class
        ::Alchemy::Picture
      end

      def file
        active_record_instance.image_file
      end

      def file=(val)
        active_record_instance.image_file = val
      end

      delegate :save, to: :active_record_instance

      def is_image?
        true
      end


      def dim
        "#{active_record_instance.image_file_width}x#{active_record_instance.image_file_height}"
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
alchemy-custom-model-3.2 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-3.1.5 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-3.1.4 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-3.1.3 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-3.1.2 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-3.1.1 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-3.1.0 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-2.2.2 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-3.0.0 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-2.2.1 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-2.2.0 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-2.1.2 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-2.1.1 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-2.1.0 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-2.0.3 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-2.0.2 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-2.0.1 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-2.0.0 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-0.1.9 lib/alchemy/custom/model/el_finder/paths/image.rb
alchemy-custom-model-0.1.7 lib/alchemy/custom/model/el_finder/paths/image.rb