Class: Admin::BackgroundJobsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Admin::BackgroundJobsController
- Defined in:
- app/controllers/admin/background_jobs_controller.rb
Defined Under Namespace
Classes: Collection
Instance Attribute Summary collapse
-
#background_job ⇒ Object
readonly
Returns the value of attribute background_job.
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
Instance Method Summary collapse
- #blocked ⇒ Object
- #completed ⇒ Object
- #discard ⇒ Object
- #discard_all ⇒ Object
- #failed ⇒ Object
- #in_progress ⇒ Object
- #index ⇒ Object
- #retry ⇒ Object
- #retry_all ⇒ Object
- #scheduled ⇒ Object
- #show ⇒ Object
Instance Attribute Details
#background_job ⇒ Object (readonly)
Returns the value of attribute background_job.
7 8 9 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 7 def background_job @background_job end |
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
7 8 9 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 7 def collection @collection end |
Instance Method Details
#blocked ⇒ Object
12 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 12 def blocked = render_state(:blocked) |
#completed ⇒ Object
14 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 14 def completed = render_state(:completed) |
#discard ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 26 def discard redirect_target = background_job.failed? ? failed_admin_background_jobs_path : admin_background_jobs_path background_job.discard redirect_to redirect_target, status: :see_other end |
#discard_all ⇒ Object
40 41 42 43 44 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 40 def discard_all SolidQueue::Job.where(id: params[:id]).find_each(&:discard) redirect_back_or_to admin_background_jobs_path, status: :see_other end |
#failed ⇒ Object
13 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 13 def failed = render_state(:failed) |
#in_progress ⇒ Object
11 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 11 def in_progress = render_state(:in_progress) |
#index ⇒ Object
9 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 9 def index = render_state(:pending) |
#retry ⇒ Object
20 21 22 23 24 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 20 def retry background_job.retry redirect_to admin_background_jobs_path, status: :see_other end |
#retry_all ⇒ Object
34 35 36 37 38 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 34 def retry_all SolidQueue::Job.failed.where(id: params[:id]).find_each(&:retry) redirect_back_or_to failed_admin_background_jobs_path, status: :see_other end |
#scheduled ⇒ Object
10 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 10 def scheduled = render_state(:scheduled) |
#show ⇒ Object
16 17 18 |
# File 'app/controllers/admin/background_jobs_controller.rb', line 16 def show render locals: { background_job: } end |