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 +4 -4
- data/lib/state_of_the_nation/query_string.rb +2 -2
- data/lib/state_of_the_nation/version.rb +1 -1
- data/lib/state_of_the_nation.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02ade11e55bbaf4cb8e730d260c73976d9342aa13dd5002d64350e58be94aea7
|
4
|
+
data.tar.gz: 41d55f54645e8fd974e1470494f70ab68bcd6db46c1c81346af2884d98e60137
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
data/lib/state_of_the_nation.rb
CHANGED
@@ -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(:
|
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
|
+
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-
|
12
|
+
date: 2020-03-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|