nexia_event_store 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec1af445ea9cc5bb3a16d7cd0e916687cb3cbbc1
4
- data.tar.gz: dfed378ea13287db955caa1f66b2c0afba232637
3
+ metadata.gz: e8b1eda40b515240bcaa7be394861f5ad1ef3649
4
+ data.tar.gz: 7f80e07b8959230608617c66773030014f582bd8
5
5
  SHA512:
6
- metadata.gz: d80dddc66f087bc75faacdcf0268d3967389bf9823251a304ab132e585872491f025a047b9e333101dc771884b5b5dbd64b90a28f3669e0cfdc3f8d8f78d24df
7
- data.tar.gz: b8f90a7e2eda9b87ce7232cd12ee09afae749611d5d807938b3d31c4aad5834b5a65406ebeadc562fb0c6f7e3f684e95017bc9f7f942d6f5850d50c08b4032e1
6
+ metadata.gz: cc0b5254311cf5d3f70caa8f92d85fac969257712f199556984e4918faf59903ee4aeebcbed997581f5a1386b3f770759ca7fae55565239e3eb5e7844e3734a6
7
+ data.tar.gz: 0ba2ee0e1fd520c1cfbea6dec5a2d53c46ab69d62efc9e6c76201cb080ea450bcd79aa17c39c824a1b3179e27ba01a5803a977ce1033de3d05c460c85d41db0b
@@ -39,16 +39,17 @@ module EventStore
39
39
  end
40
40
 
41
41
  def last_event_before(start_time, fully_qualified_names = [])
42
- names = fully_qualified_names.map { |n| "\'#{n}\'" }.join(',')
42
+ timestampz = start_time.strftime("%Y-%m-%d %H:%M:%S%z")
43
+ names = fully_qualified_names.map { |n| "'#{n}'" }.join(',')
43
44
  last_event_before_query = <<-EOSQL
44
45
  select * from
45
46
  (select *, last_value(occurred_at)
46
47
  over(partition by fully_qualified_name order by occurred_at
47
48
  ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as last
48
49
  from #{@event_table}
49
- where aggregate_id = \'#{@id}\'
50
+ where aggregate_id = '#{@id}'
50
51
  and fully_qualified_name in (#{names})
51
- and occurred_at < \'#{start_time}\') as subquery
52
+ and occurred_at < '#{timestampz}') as subquery
52
53
  where occurred_at = last
53
54
  EOSQL
54
55
 
@@ -1,3 +1,3 @@
1
1
  module EventStore
2
- VERSION = '0.5.2'
2
+ VERSION = '0.5.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexia_event_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Saieg, John Colvin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-12 00:00:00.000000000 Z
12
+ date: 2015-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -273,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
273
  version: '0'
274
274
  requirements: []
275
275
  rubyforge_project:
276
- rubygems_version: 2.4.2
276
+ rubygems_version: 2.4.5
277
277
  signing_key:
278
278
  specification_version: 4
279
279
  summary: Ruby implementation of an EventSource (A+ES) for the Nexia Ecosystem