2015-02-20 12:13:48 +00:00
|
|
|
class Projects::UploadsController < Projects::ApplicationController
|
2017-05-01 13:14:35 +00:00
|
|
|
include UploadsActions
|
|
|
|
|
2017-02-01 18:21:28 +00:00
|
|
|
skip_before_action :project, :repository,
|
|
|
|
if: -> { action_name == 'show' && image_or_video? }
|
2015-02-20 12:13:48 +00:00
|
|
|
|
2016-03-21 23:09:20 +00:00
|
|
|
before_action :authorize_upload_file!, only: [:create]
|
2016-03-20 20:03:53 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
2017-12-06 11:36:11 +00:00
|
|
|
def show_model
|
|
|
|
strong_memoize(:show_model) do
|
|
|
|
namespace = params[:namespace_id]
|
|
|
|
id = params[:project_id]
|
2015-04-17 09:33:53 +00:00
|
|
|
|
2017-12-06 11:36:11 +00:00
|
|
|
Project.find_by_full_path("#{namespace}/#{id}")
|
2015-04-17 09:33:53 +00:00
|
|
|
end
|
2017-05-01 13:14:35 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
alias_method :model, :project
|
2015-02-20 13:39:35 +00:00
|
|
|
end
|