Sha256: 936ef0fb1b2cb23171cf24237d3484cc9f2c37bd65893a168b8057db79ec0985

Contents?: true

Size: 911 Bytes

Versions: 2

Compression:

Stored size: 911 Bytes

Contents

class Models::BaseFile
  inherit FileModel

  # box :default
  # storage rad.config.fs_type

  # def sanitize_regexp
  #   /[^[:word:]\.\-\+\s_]/i
  # end

  def model_id
    model._id || model._parent._id || raise("id not defined!")
  end

  def build_path name, version = nil
    "#{rad.models.fs['prefix']}/system/#{model.class.alias.underscore}/#{model_id}" + build_standard_path(name, version)
  end

  def build_url name, version = nil
    "#{rad.models.fs['host']}#{rad.models.fs['prefix']}/system/#{model.class.alias.underscore}/#{model_id}" + build_standard_url(name, version)
  end

  # def file_path
  #   "#{rad.config.fs_prefix}/system/#{model.class.model_name.underscore}/#{model.id}"
  # end
  #
  # def store_dir
  #   "#{root}#{file_path}"
  # end
  #
  # def extension_white_list
  #   [/.*/]
  # end
  #
  # def cache_dir; rad.config.fs_cache_path end
  # def root; rad.config.fs_path end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rad_kit-0.0.10 lib/kit/models/base_file.rb
rad_kit-0.0.9 lib/kit/models/base_file.rb