It's easier to skip the check in the two places that we need to, and include it by default everywhere else.
16 lines
405 B
Ruby
16 lines
405 B
Ruby
module Api
|
|
class UserBlocksController < ApiController
|
|
authorize_resource
|
|
|
|
around_action :api_call_handle_error, :api_call_timeout
|
|
before_action :set_request_formats
|
|
|
|
def show
|
|
raise OSM::APIBadUserInput, "No id was given" unless params[:id]
|
|
|
|
@user_block = UserBlock.find(params[:id])
|
|
rescue ActiveRecord::RecordNotFound
|
|
raise OSM::APINotFoundError
|
|
end
|
|
end
|
|
end
|