Class: Tramway::Api::ApplicationController

Inherits:
Core::ApplicationController
  • Object
show all
Includes:
Knock::Authenticable
Defined in:
app/controllers/tramway/api/application_controller.rb

Direct Known Subclasses

V1::ApplicationController

Instance Method Summary collapse

Instance Method Details

#authenticateObject



18
19
20
21
22
# File 'app/controllers/tramway/api/application_controller.rb', line 18

def authenticate
  return if current_tramway_user || params[:user_based_model].in?(Tramway::Api.user_based_models)

  unauthorized
end

#not_foundObject



10
11
12
# File 'app/controllers/tramway/api/application_controller.rb', line 10

def not_found
  render json: { data: [] }, status: :not_found
end

#unauthorizedObject



14
15
16
# File 'app/controllers/tramway/api/application_controller.rb', line 14

def unauthorized
  head :unauthorized
end