trailblazer-finder 0.2.6 → 0.2.7

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: f862084bc39a581d2e11d369f44f9189122c7970cc7741082f9009f31a7aa12e
4
- data.tar.gz: d30a06f86071cd2c88c3f6afc31e4860d93a9a985dbec488812cae444b78fbed
3
+ metadata.gz: 81be12acd7b9578205af33adb7c4ec7b8c3cfd5d5b14922b377c2221396ddb94
4
+ data.tar.gz: 1eb13fa24716d87215c0ce14e23b4a3e748242339c833b4a402c16c5bf9b4084
5
5
  SHA512:
6
- metadata.gz: f6a7e27f822d6bb9f9b140df060adcd69efa99e73d865e644560f5d23d2f1f00e8f77c3a2d5fbc9d81cd64bc9d468cbf6916400ba6422a1fce2de2d5bfadb4c8
7
- data.tar.gz: b4810e6d1db60a5daf2357586d4a67bc0bbc3f4bf8a1f9c850ead94f387177c76a3df54e818a3ec695cdb252c9405ff3d83b1cc32070cbe4348786892ab11f31
6
+ metadata.gz: 5efd0d9ae65bef07f8ff838f324d1421d20496e7f3b321859b580ee9057011dfc856a1dc1e631fda9f33d92ecb4da27880687b418c2e223db008062b029ec6de
7
+ data.tar.gz: 74b411ad786feb26a28a01db862914e28e8746c3617ed4ca14d07e2bec9bf2f5fc9dcf657fc0bb86b6d3c62471b1c37f94f88c5eab6561e0d9d11e4bbc12a534
data/CHANGES.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.2.7
2
+ * Don't cast uuids to dates in the filters
3
+
1
4
  # 0.1.4
2
5
  * Updated DataMapper Adapter to include sorting by multiple columns/directions and the predicate feature.
3
6
 
@@ -36,7 +36,12 @@ module Trailblazer
36
36
  end
37
37
 
38
38
  def self.date?(date)
39
- date_hash = Date._parse(date.to_s)
39
+ return false unless
40
+ date.kind_of?(::DateTime) ||
41
+ date.kind_of?(::Date) ||
42
+ date.kind_of?(::String)
43
+ return false if date.kind_of?(::String) && date.size == 36 # Ignore uuids that could get casted to dates
44
+ date_hash = ::Date._parse(date.to_s)
40
45
  Date.valid_date?(date_hash[:year].to_i, date_hash[:mon].to_i, date_hash[:mday].to_i)
41
46
  end
42
47
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Trailblazer
4
4
  class Finder
5
- VERSION = "0.2.6"
5
+ VERSION = "0.2.7"
6
6
  end
7
7
  end
@@ -35,6 +35,7 @@ module Trailblazer
35
35
  expect(described_class.date?("2018/01/01")).to eq true
36
36
  expect(described_class.date?("2018.01.01")).to eq true
37
37
  expect(described_class.date?("21-12-2018")).to eq true
38
+ expect(described_class.date?("0fae2de1-6537-4d36-9cdb-30edf1e37990")).to eq false
38
39
  end
39
40
  end
40
41
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-09-04 00:00:00.000000000 Z
12
+ date: 2020-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dry-types