aboutsummaryrefslogtreecommitdiff
path: root/app/jobs/enqueued_jobs.rb
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-03-16 08:51:54 +0000
committerChristopher Baines <mail@cbaines.net>2018-03-29 07:55:01 +0100
commit051c8bf612126fa79699c8bf45a661dde127f4a0 (patch)
tree849a3b05b4ab4b59a426761d7cf1da3cc7036349 /app/jobs/enqueued_jobs.rb
parenta8c8f68971dd9e20dee01d9f65c64283e41fe4a3 (diff)
downloadgovuk-mini-environment-admin-051c8bf612126fa79699c8bf45a661dde127f4a0.tar
govuk-mini-environment-admin-051c8bf612126fa79699c8bf45a661dde127f4a0.tar.gz
Add backend controllers, models and views
Also annotate existing models.
Diffstat (limited to 'app/jobs/enqueued_jobs.rb')
-rw-r--r--app/jobs/enqueued_jobs.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/jobs/enqueued_jobs.rb b/app/jobs/enqueued_jobs.rb
new file mode 100644
index 0000000..c394611
--- /dev/null
+++ b/app/jobs/enqueued_jobs.rb
@@ -0,0 +1,12 @@
+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}")
+ end
+end
+