2018-09-14 01:42:05 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-28 17:56:49 -04:00
|
|
|
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-10-17 08:07:33 -04:00
|
|
|
@board_parent ||= board.resource_parent
|
2017-08-28 17:56:49 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def record_not_found(exception)
|
|
|
|
render json: { error: exception.message }, status: :not_found
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|