Commit ea908964 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'rs-simplify-uploads-controller' into 'master'

Simplify the `skip_before_action` logic for UploadsController

See merge request !547
parents 54d7962f 10053b17
Pipeline #18471 failed with stage
class Projects::UploadsController < Projects::ApplicationController
layout 'project'
# We want to skip these filters for only the `show` action if `image?` is true,
# but `skip_before_filter` doesn't work with both `only` and `if`, so we accomplish the same like this.
skipped_filters = [:authenticate_user!, :reject_blocked!, :project, :repository]
skip_before_action *skipped_filters, only: [:show]
before_action *skipped_filters, only: [:show], unless: :image?
skip_before_action :authenticate_user!, :reject_blocked!, :project,
:repository, if: -> { action_name == 'show' && image? }
def create
link_to_file =, params[:file]).
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment