Sha256: 64439b6d65723084b420ae0399a0c38e27fc64a7e7a1b1a2f9422fa1fea69b0a

Contents?: true

Size: 990 Bytes

Versions: 27

Compression:

Stored size: 990 Bytes

Contents

module Alchemy::Custom::Model::ElFinder
  module Volumes
    class AlchemyFiles < AlchemyFile

      def initialize(options = {root: '/files', name: 'Alchemy Library - Files', id: 'alchemy_library_files', url: '/'})
        super
      end

      def files(target = '.')
        super(root_path)
      end

      def decode(hash)
        super do |path|
          Paths::File.new(@root, path, volume: self)
        end
      end

      def upload(target, upload)
        super do |file|
          f = ::Alchemy::Attachment.create(
              file: file
          )
          root_path.build_file_path(f)
        end
      end

      def search(type:, q:)

        super do
          search_query_build(klass: ::Alchemy::Attachment, type: type, q: q, mime_attribute: :file_mime_type)
        end

      end

      def disabled_commands

        super + ['rm']

      end

      private

      def root_path
        Paths::Files.new(@root, '.', volume: self)
      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/volumes/alchemy_files.rb
alchemy-custom-model-3.1.5 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-3.1.4 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-3.1.3 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-3.1.2 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-3.1.1 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-3.1.0 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-2.2.2 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-3.0.0 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-2.2.1 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-2.2.0 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-2.1.2 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-2.1.1 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-2.1.0 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-2.0.3 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-2.0.2 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-2.0.1 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-2.0.0 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-0.1.9 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb
alchemy-custom-model-0.1.7 lib/alchemy/custom/model/el_finder/volumes/alchemy_files.rb