debian-mirror-gitlab/app/controllers/boards/application_controller.rb

24 lines
475 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
module Boards
class ApplicationController < ::ApplicationController
respond_to :json
rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
private
def board
@board ||= Board.find(params[:board_id])
end
def board_parent
2019-12-21 20:55:43 +05:30
@board_parent ||= board.resource_parent
2018-03-17 18:26:18 +05:30
end
def record_not_found(exception)
render json: { error: exception.message }, status: :not_found
end
end
end