diff options
author | Christopher Baines <mail@cbaines.net> | 2018-03-25 19:45:01 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-04-03 21:57:39 +0100 |
commit | d110a140e2f4625c301ba07fe232ec3b82dc0a8b (patch) | |
tree | 24724af70024b19a49b8daf790b3fc91f7654e2a /app/jobs | |
parent | 03c08cee3de0509e15b64d8937d1b759b8368a72 (diff) | |
download | govuk-mini-environment-admin-d110a140e2f4625c301ba07fe232ec3b82dc0a8b.tar govuk-mini-environment-admin-d110a140e2f4625c301ba07fe232ec3b82dc0a8b.tar.gz |
Refactor the EnqueuedJobs class
Neaten it up with the help of Rubocop.
Diffstat (limited to 'app/jobs')
-rw-r--r-- | app/jobs/enqueued_jobs.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/app/jobs/enqueued_jobs.rb b/app/jobs/enqueued_jobs.rb index c394611..220899c 100644 --- a/app/jobs/enqueued_jobs.rb +++ b/app/jobs/enqueued_jobs.rb @@ -1,12 +1,9 @@ module EnqueuedJobs def enqueued_jobs(argument = nil) - if argument - condition = " AND args->>0 = '#{argument}'" - else - condition = "" - end - - Que.execute("SELECT * FROM que_jobs WHERE job_class = '#{name}'#{condition}") + condition = argument ? " AND args->>0 = '#{argument}'" : '' + + Que.execute( + "SELECT * FROM que_jobs WHERE job_class = '#{name}'#{condition}" + ) end end - |