postjob 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/postjob/queue/search.rb +7 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00a785d7f9bd7a640601fb385902e157a76bf02a
4
- data.tar.gz: 7368f6f79e2f0392979656ff05bd12acc20751e9
3
+ metadata.gz: 5166951ca6511e2d599b44493288dc1ac43f712a
4
+ data.tar.gz: f32f0a3255c782e5998d8c77b68b8e5656f356ae
5
5
  SHA512:
6
- metadata.gz: a09cd7a9014e1dddf95f493b064ae8e818ff65b98fd0db3ba15bf8de50e499b5d8c45ec919db52f994692c14b0550aa184dd74d9d4b76ba033c4109de59562f5
7
- data.tar.gz: 748047574250f33ea51cad3a823ecb2c7d66afa7263c4388d66157a0e58948433676935816794dde089b0c8f1cbcf10c24de6310723d12f61e578a6a08c4986e
6
+ metadata.gz: 40f67bc7082fc9df09bda3c4425297ffa7ce6ddaed0feef2bb849a3b9e5773a06a6b5349972c8f5c8f0d5c7cefb4cc7b1e0f64ce8da336d52fa0239a5e45fde1
7
+ data.tar.gz: d5928e359abfc51dbeab4a1054d435dbba799ba5107296ccd2b65494e2c9853fca350ab88eba9f291ead1736026b74e04371d6830afad77a8b08bb60020a1ed8
@@ -40,7 +40,9 @@ module Postjob::Queue
40
40
  end
41
41
 
42
42
  converted_filters = filter.inject({}) do |hsh, (key, value)|
43
- hsh.update key => convert_filter_value(value, key: key)
43
+ matches = convert_filter_value(value, key: key)
44
+ matches = matches.first if matches.length == 1
45
+ hsh.update key => matches
44
46
  end
45
47
 
46
48
  column_filters, tags_filters = converted_filters.partition { |key, _| !column_types[key].nil? }
@@ -71,14 +73,10 @@ module Postjob::Queue
71
73
  value = Array(value)
72
74
 
73
75
  case Postjob::Queue.column_types[key]
74
- when "bigint" then simplify_array(value.map(&:to_i))
75
- when "integer" then simplify_array(value.map(&:to_i))
76
- when nil then simplify_array(value.map(&:to_i) + value.map(&:to_s))
77
- else simplify_array(value.map(&:to_s))
76
+ when "bigint" then value.map { |v| Integer(v) }
77
+ when "integer" then value.map { |v| Integer(v) }
78
+ when nil then value.map(&:to_s) + value.grep(/\A-?\d+\z/).map(&:to_i)
79
+ else value.map(&:to_s)
78
80
  end
79
81
  end
80
-
81
- def simplify_array(ary)
82
- ary.length == 1 ? ary.first : ary
83
- end
84
82
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postjob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel