statesman 7.2.0 → 7.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/statesman/adapters/active_record.rb +10 -4
- data/lib/statesman/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 444b828dd17ce5984d99e93e25ff774ccbc621a06d0afeb51dc6d8a4b7cd0bc5
|
4
|
+
data.tar.gz: 8e70e4e74a6edc795d66f203619974c1483d8b2a3b02a19e5264ba588e991a37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e354a540525c8ab3a2c2f0de4b7c6eb4ecc931f54e1d46dca64f03e910a3f95267f94fb61584444f53e37891ac5a8bd75a2054001eaff118a8a3c5eccad6be3
|
7
|
+
data.tar.gz: 1f2266d2181d451621ca355c9c5e8db982548f0028c65af723e3d9164deb43f1516e1550fd11678f99b5243e47302ee5fcd916cc2b0f9fb6f7dc9a4a8edb6218
|
@@ -113,7 +113,7 @@ module Statesman
|
|
113
113
|
to_state: to,
|
114
114
|
sort_key: next_sort_key,
|
115
115
|
metadata: metadata,
|
116
|
-
most_recent: not_most_recent_value,
|
116
|
+
most_recent: not_most_recent_value(db_cast: false),
|
117
117
|
}
|
118
118
|
end
|
119
119
|
|
@@ -316,6 +316,10 @@ module Statesman
|
|
316
316
|
::ActiveRecord::Base.connection.quote(value)
|
317
317
|
end
|
318
318
|
|
319
|
+
def db_null
|
320
|
+
Arel::Nodes::SqlLiteral.new("NULL")
|
321
|
+
end
|
322
|
+
|
319
323
|
# Check whether the `most_recent` column allows null values. If it doesn't, set old
|
320
324
|
# records to `false`, otherwise, set them to `NULL`.
|
321
325
|
#
|
@@ -323,10 +327,12 @@ module Statesman
|
|
323
327
|
# indexes. By doing the conditioning on the column, rather than Rails' opinion of
|
324
328
|
# whether the database supports partial indexes, we're robust to DBs later adding
|
325
329
|
# support for partial indexes.
|
326
|
-
def not_most_recent_value
|
327
|
-
|
330
|
+
def not_most_recent_value(db_cast: true)
|
331
|
+
if transition_class.columns_hash["most_recent"].null == false
|
332
|
+
return db_cast ? db_false : false
|
333
|
+
end
|
328
334
|
|
329
|
-
nil
|
335
|
+
db_cast ? db_null : nil
|
330
336
|
end
|
331
337
|
end
|
332
338
|
|
data/lib/statesman/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statesman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ammeter
|
@@ -283,7 +283,7 @@ homepage: https://github.com/gocardless/statesman
|
|
283
283
|
licenses:
|
284
284
|
- MIT
|
285
285
|
metadata: {}
|
286
|
-
post_install_message:
|
286
|
+
post_install_message:
|
287
287
|
rdoc_options: []
|
288
288
|
require_paths:
|
289
289
|
- lib
|
@@ -299,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
299
299
|
version: '0'
|
300
300
|
requirements: []
|
301
301
|
rubygems_version: 3.1.1
|
302
|
-
signing_key:
|
302
|
+
signing_key:
|
303
303
|
specification_version: 4
|
304
304
|
summary: A statesman-like state machine library
|
305
305
|
test_files:
|