• Yorick Peterse's avatar
    Move EE prepend/include to the end of services · 9f4735d3
    Yorick Peterse authored
    This moves all instances of `prepend EE::Something` and `include
    EE::Something` in service classes to the last line of the corresponding
    service class.  This pushes EE specific code further down the files,
    reducing the likelihood of developers running into merge conflicts.
    9f4735d3
update_service.rb 569 Bytes
# frozen_string_literal: true

module Members
  class UpdateService < Members::BaseService
    # returns the updated member
    def execute(member, permission: :update)
      raise Gitlab::Access::AccessDeniedError unless can?(current_user, action_member_permission(permission, member), member)

      old_access_level = member.human_access

      if member.update(params)
        after_execute(action: permission, old_access_level: old_access_level, member: member)
      end

      member
    end
  end
end

Members::UpdateService.prepend(EE::Members::UpdateService)