diff options
| author | mo khan <mo@mokhan.ca> | 2013-12-31 13:54:51 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2013-12-31 13:54:58 -0700 |
| commit | 006f5c8322eb4b44f1ac25cbab8d4eec76f184d1 (patch) | |
| tree | 083418a81b9673e3aeab918d7212f4111d4683d2 /app/controllers/admin | |
| parent | 476508fcc41ada7d0a07a5c2cc6543915120d38f (diff) | |
extract dependency into constructor. fixes #15.
Diffstat (limited to 'app/controllers/admin')
| -rw-r--r-- | app/controllers/admin/jobs_controller.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/admin/jobs_controller.rb b/app/controllers/admin/jobs_controller.rb index 724b61cf..0bdafe84 100644 --- a/app/controllers/admin/jobs_controller.rb +++ b/app/controllers/admin/jobs_controller.rb @@ -1,11 +1,16 @@ module Admin class JobsController < AdminController + def initialize(repository = Delayed::Job) + @repository = repository + super() + end + def index - @jobs = Delayed::Job.order(:created_at => :desc) + @jobs = @repository.order(:created_at => :desc) end def show - @job = Delayed::Job.find(params[:id]) + @job = @repository.find(params[:id]) end end end |
