Sha256: 1fa0d7d17dce4f1b42ab3b43c0852c31cac9a52cc476518a4d58af44f016ae63

Contents?: true

Size: 359 Bytes

Versions: 13

Compression:

Stored size: 359 Bytes

Contents

module Sufia::UploadsControllerBehavior
  extend ActiveSupport::Concern

  included do
    load_and_authorize_resource class: Sufia::UploadedFile
  end

  def create
    @upload.attributes = { file: params[:files].first,
                           user: current_user }
    @upload.save!
  end

  def destroy
    @upload.destroy
    head :no_content
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sufia-7.4.1 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.4.0 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.3.1 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.3.0 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.3.0.rc3 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.3.0.rc2 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.3.0.rc1 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.2.0 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.1.0 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.0.0 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.0.0.rc2 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.0.0.rc1 app/controllers/concerns/sufia/uploads_controller_behavior.rb
sufia-7.0.0.beta4 app/controllers/concerns/sufia/uploads_controller_behavior.rb