Sha256: c0b01eba9650900ae105030948a5ea81e3d037c18a81d3a59abbf93265f44655

Contents?: true

Size: 767 Bytes

Versions: 4

Compression:

Stored size: 767 Bytes

Contents

require 'deprecation'
module Hydra::HydraUploaderHelperBehavior
  extend Deprecation
  self.deprecation_horizon = 'hydra-head 5.x'
  
  # Generate the appropriate url for posting uploads to
  # Uses the +container_id+ method to figure out what container uploads should go into
  def upload_url
    upload_url = hydra_asset_file_assets_path(:asset_id=>container_id)
  end
  deprecation_deprecate :upload_url
  
  # The id of the container that uploads should be posted into
  # If params[:container_id] is not set, it uses params[:id] (assumes that you're uploading items into the current object)
  def container_id
    if !params[:asset_id].nil?
      return params[:asset_id]
    else
      return params[:id]
    end
  end
  deprecation_deprecate :container_id
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hydra-head-4.1.3 app/helpers/hydra/hydra_uploader_helper_behavior.rb
hydra-head-4.1.2 app/helpers/hydra/hydra_uploader_helper_behavior.rb
hydra-head-4.1.1 app/helpers/hydra/hydra_uploader_helper_behavior.rb
hydra-head-4.1.0 app/helpers/hydra/hydra_uploader_helper_behavior.rb