state_of_the_nation 1.1.4 → 1.1.5

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: 97a7482f3c135b954fe912e2bb6b8948f4ba14596e282a91687aec9cbcb06b3d
4
- data.tar.gz: 4577435dca22e84ded9236bc52b94cc24d02681973697623d5bca3c884034d6b
3
+ metadata.gz: 02ade11e55bbaf4cb8e730d260c73976d9342aa13dd5002d64350e58be94aea7
4
+ data.tar.gz: 41d55f54645e8fd974e1470494f70ab68bcd6db46c1c81346af2884d98e60137
5
5
  SHA512:
6
- metadata.gz: d00dd78d49cd44f1c79ad9c316d1e4843bb255f5b7728f0cb813bd656d8b3ff794c3d5dffa4013bf3d9e4805dda858f01bace09557c241e0b69d3869b06fd3f7
7
- data.tar.gz: 11dbf26dbddd36bc93c408f6679c9980044c990c4ba4990298dd86ca1633687d5bfc0df9b13b38ad067d12645a3b001989e2356a175405ea3ed34a1cc354f5ed
6
+ metadata.gz: 6db7e850c08dda81286a85655516de4e13c57872ef23709875a268a86c41e8548ae1fd6ccb6b416a184ef2de272956dc6783cda7022116e0b2d494de45698194
7
+ data.tar.gz: e9b03e89653353fd344bfa71ce9538c1abdab8e93afd8611d359be0c8c0c005a60732de7dfa4310530fa5f942394abb9062dfef1a4cf3438abf07c553e7f6911
@@ -10,13 +10,13 @@ module StateOfTheNation
10
10
  active_scope: "(%{finish_key} IS NULL OR %{finish_key} > ?::timestamp) AND %{start_key} <= ?::timestamp",
11
11
  less_than: "(%{start_key} < ?::timestamp)",
12
12
  greater_than_or_null: "(%{finish_key} > ?::timestamp) OR (%{finish_key} IS NULL)",
13
- start_and_finish_not_equal: "(%{start_key} != %{finish_key})",
13
+ start_and_finish_not_equal_or_are_null: "(%{start_key} != %{finish_key}) OR (%{start_key} IS NULL) OR (%{finish_key} IS NULL)",
14
14
  },
15
15
  mysql: {
16
16
  active_scope: "(%{finish_key} IS NULL OR %{finish_key} > ?) AND %{start_key} <= ?",
17
17
  less_than: "(%{start_key} < ?)",
18
18
  greater_than_or_null: "(%{finish_key} > ?) OR (%{finish_key} IS NULL)",
19
- start_and_finish_not_equal: "(%{start_key} != %{finish_key})"
19
+ start_and_finish_not_equal_or_are_null: "(%{start_key} != %{finish_key}) OR (%{start_key} IS NULL) OR (%{finish_key} IS NULL)"
20
20
  }
21
21
  }[appropriate_db_type(klass)]
22
22
  end
@@ -1,3 +1,3 @@
1
1
  module StateOfTheNation
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
@@ -129,8 +129,9 @@ module StateOfTheNation
129
129
  # find competing records which *finish* being active AFTER this record *starts* being active
130
130
  # (or ones which are not set to finish being active)
131
131
 
132
- records = records.where(QueryString.query_for(:start_and_finish_not_equal, self.class)) if ignore_empty
132
+ records = records.where(QueryString.query_for(:start_and_finish_not_equal_or_are_null, self.class)) if ignore_empty
133
133
  # exclude records where there is no difference between start and finish dates
134
+ # (we need to deliberately not filter out records with null value keys with this comparison as not equal comparisons to null are always deemed null/false)
134
135
 
135
136
  records
136
137
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_of_the_nation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick O'Doherty
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-02-19 00:00:00.000000000 Z
12
+ date: 2020-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler