que-view 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48aaed2dc98a7238f4baa10b5f12c0c67dbd03a5ea588a6d184d95f077f356dd
4
- data.tar.gz: 27ed335bcfa4b1a21380438ab1fee77e6f92f123828b1d88d8f8ace39a269dce
3
+ metadata.gz: ca1165b499081e6a124caf37e168c75bd7e74d79c6cd7d4e6445925b9c32589e
4
+ data.tar.gz: e844c8f96e9eb7021124bb8e420302629805637fa0af9caef16d1b5aad5b03a1
5
5
  SHA512:
6
- metadata.gz: ef87394a2f147a65384f2aa44d8695a734f3ae9c1c451d25bb763dd45a0cd582269597f21809c5cc1847ad1a1113dca4940baac8751cfe1ccd08910222929d1e
7
- data.tar.gz: 4f83aca9ad32a0dd37b6948d69511f6193412f9bf3221b0db53001e2f37535cc6aac053bc252612005af120270c059e6f3aa1889128f41dd1e0e466c85e268b7
6
+ metadata.gz: f0256e1fce181ec2ff9864bbe1e9b90deff9191cd0421415ebf077445683bd23b1f9a2418bfb5f582c4a679c2c0509fe478b644e4f561fbf6f1936be27c5abae
7
+ data.tar.gz: ca009f6f1c8b8af5bfb9963daef9c32eaead6120b0558eb37542dd5a49845ffe9faeebf97ae6594e5023f171346858c9ed869cc214db56a3ac74979e63456521
data/lib/que/view/dsl.rb CHANGED
@@ -163,10 +163,17 @@ module Que
163
163
 
164
164
  def fetch_job_names_sql(queue_name)
165
165
  <<-SQL.squish
166
- SELECT COUNT(*) AS count_all, args #>> '{0, job_class}' AS job_name
166
+ SELECT COUNT(*) AS count_all,
167
+ CASE
168
+ WHEN job_class = 'ActiveJob::QueueAdapters::QueAdapter::JobWrapper' THEN args #>> '{0, job_class}'
169
+ ELSE job_class
170
+ END AS job_name
167
171
  FROM que_jobs
168
172
  #{queue_name.present? ? "WHERE queue = '#{queue_name}'" : ""}
169
- GROUP BY args #>> '{0, job_class}'
173
+ GROUP BY CASE
174
+ WHEN job_class = 'ActiveJob::QueueAdapters::QueAdapter::JobWrapper' THEN args #>> '{0, job_class}'
175
+ ELSE job_class
176
+ END
170
177
  SQL
171
178
  end
172
179
 
@@ -208,7 +215,17 @@ module Que
208
215
  def search_condition(params)
209
216
  result = ''
210
217
  result += "AND queue = '#{params[:queue_name]}'" if params[:queue_name].present?
211
- result += "AND args #>> '{0, job_class}' = ('#{params[:job_name]}')" if params[:job_name].present?
218
+ if params[:job_name].present?
219
+ result += <<~SQL
220
+ AND (
221
+ job_class = '#{params[:job_name]}'
222
+ OR (
223
+ job_class = 'ActiveJob::QueueAdapters::QueAdapter::JobWrapper'
224
+ AND args #>> '{0, job_class}' = '#{params[:job_name]}'
225
+ )
226
+ )
227
+ SQL
228
+ end
212
229
  result
213
230
  end
214
231
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Que
4
4
  module View
5
- VERSION = '0.4.1'
5
+ VERSION = '0.4.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: que-view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdanov Anton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-08 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: que