Class: JobsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/jobs_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
# File 'app/controllers/jobs_controller.rb', line 7

def index
  render json: current_entity.jobs
end

#popObject



3
4
5
# File 'app/controllers/jobs_controller.rb', line 3

def pop
  render json: Job.pop
end

#showObject



11
12
13
# File 'app/controllers/jobs_controller.rb', line 11

def show
  render json: current_entity.jobs.find(params[:id]), show_all: true
end

#update_statusObject



15
16
17
18
# File 'app/controllers/jobs_controller.rb', line 15

def update_status
  Job.find_by!(key: params[:id]).update!(status: params[:status])
  render plain: 'OK'
end