Class: Api::V1::ApplicationController

Inherits:
ActionController::API
  • Object
show all
Defined in:
app/controllers/api/v1/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#ticket_founded?Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'app/controllers/api/v1/application_controller.rb', line 8

def ticket_founded?
  @ticket = Ticket.find_by(user_id: @user.id, status: :active)
  return ticket_not_found_response unless @ticket.present?
end

#unauthorized?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'app/controllers/api/v1/application_controller.rb', line 4

def unauthorized?
  return unauthorized_response unless find_user_by_header
end