azahara_schema 0.5.0 → 0.5.1

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: bda25d077a33a251950c828875e82a1a959890d18b617a8b0dc1062f74ab0388
4
- data.tar.gz: 92bfc2024428a90b4886aecb76ab2a3bd0fd5ded5061813b5357c0dfb117ec44
3
+ metadata.gz: d71e803ac5710793409dda0076fd06fb9d161c27d8f535b1b7e52280013dcec9
4
+ data.tar.gz: 449f11f7d37861f8c052e79601969bacb8de7193133103bf446ecc8528b4a99f
5
5
  SHA512:
6
- metadata.gz: d5bbe4f88b69265cb246a2fc12fa5d4a7972a88550e60fc11464cb7794610144e186b6d40c68a90a682308a26d794f3c551154ad8a2459f9e3f39ed01d0c2b1d
7
- data.tar.gz: ad30146b413c18d7a2d81580a32d82d10f2233c107c97340f5cc2586f2cdf7055476d4c1b23ad9d1e953229c528e2f5ca77ddf64111b66c2a50b8c813dd6f839
6
+ metadata.gz: edf1b6b899dd4ff988dd716d485cf85d821163570180f58f16e9272cc1da623862fad582b8f23575b45fe33dc422722cb5d3779f1eadcc8ff33a82abca456bb3
7
+ data.tar.gz: f16564298b872f4dbf932646a7b21aa5317dc1d6916622e6b58876d07b07d99441e867e3f404a3842769e3f4d5f2512fa3cf8621ad6159f3bbf1f7f62fd02d8c
@@ -89,9 +89,17 @@ module AzaharaSchema
89
89
  vals[1..-1].each{|v| arl = arl.or( arel_field.matches("%#{v}%") ) }
90
90
  arl
91
91
  when '>='
92
- arel_field.gteq(values.map(&:to_f).min)
92
+ if values.any? { /\d{4}-\d{2}-\d{2}/ =~ _1 }
93
+ arel_field.lteq(values.map { Date.parse(_1) }.min)
94
+ else
95
+ arel_field.lteq(values.map(&:to_f).min)
96
+ end
93
97
  when '<='
94
- arel_field.lteq(values.map(&:to_f).max)
98
+ if values.any? { /\d{4}-\d{2}-\d{2}/ =~ _1 }
99
+ arel_field.lteq(values.map { Date.parse(_1) }.max)
100
+ else
101
+ arel_field.lteq(values.map(&:to_f).max)
102
+ end
95
103
  when '@>'
96
104
  require 'arel/azahara_postgres_exts'
97
105
  arel_field.contains(values)
@@ -1,3 +1,3 @@
1
1
  module AzaharaSchema
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azahara_schema
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
  - Ondřej Ezr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-06 00:00:00.000000000 Z
11
+ date: 2024-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails