entity_store_sequel 0.0.6 → 0.0.7

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: 6383f09bbc2fdac950f5b987c3ce8ec2e73b4bed
4
- data.tar.gz: aeb1e6e1c86669c465a19e32c2b6919466dea047
3
+ metadata.gz: e2a414001d703072be6f5e520648088fe3f40862
4
+ data.tar.gz: e5a4843d072fb717697d0121b9b849c67d1374f2
5
5
  SHA512:
6
- metadata.gz: c16b67733448c4638214e5118445906b34ad56fd8919713e8ac2906f27731770e7e239415c5cfbde6a330870634ab0a6499931e24bc9f4517c9520b31bbfea01
7
- data.tar.gz: f753bfbf8cf5c0fc17b1971fde91ae83f826c2ee432ae579ca0ee665d5607c440b00ce4611dba9424babfe557584443f92ef1ffa72c7aa310dd852b91ba21bf9
6
+ metadata.gz: 020d70b51d59a8046eb33ada3585e3aa33e69cc34b58feae3ac5d4c1d1625d390cded40216f57a7878fdb4bf03cda20839fa061a397fc9ff8f8eeb67f22733dc
7
+ data.tar.gz: 88fcad47ea08f82c28a6e841297a185f47e91e1f124fa44bd223feb5c5dcb443bf1f9f626ac7341e58e28e1cd1957dd07903e026bf8505f886a30a5458bc6c02
@@ -118,9 +118,11 @@ module EntityStoreSequel
118
118
  doc = {
119
119
  :id => id.to_s,
120
120
  :_type => event.class.name,
121
- :_entity_id => BSON::ObjectId.from_string(event.entity_id).to_s,
121
+ :_entity_id => event.entity_id.to_s,
122
122
  :entity_version => event.entity_version,
123
- :data => PigeonHole.generate(hash_without_keys(event.attributes, :entity_id)),
123
+ :by => event.attributes[:by],
124
+ :at => event.attributes[:at],
125
+ :data => PigeonHole.generate(hash_without_keys(event.attributes, :entity_id, :by, :at)),
124
126
  }
125
127
  events.insert(doc)
126
128
  end
@@ -216,6 +218,8 @@ module EntityStoreSequel
216
218
  hash[:_id] = attrs[:id]
217
219
  hash[:entity_version] = attrs[:entity_version]
218
220
  hash[:entity_id] = attrs[:_entity_id]
221
+ hash[:by] = attrs[:by]
222
+ hash[:at] = attrs[:at]
219
223
  EntityStore::Config.load_type(attrs[:_type]).new(hash)
220
224
  rescue => e
221
225
  log_error "Error loading type #{attrs[:_type]}", e
@@ -1,3 +1,3 @@
1
1
  module EntityStoreSequel
2
- VERSION = "0.0.6".freeze
2
+ VERSION = "0.0.7".freeze
3
3
  end
@@ -0,0 +1,11 @@
1
+ Sequel.migration do
2
+ up do
3
+ alter_table(:entity_events) do
4
+ add_column :by, :char, size: 24, null: true
5
+ add_column :at, :timestamp, null: true
6
+ end
7
+ end
8
+
9
+ down do
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: entity_store_sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Binns
@@ -91,6 +91,7 @@ files:
91
91
  - lib/entity_store_sequel/version.rb
92
92
  - lib/sequel/core_ext.rb
93
93
  - lib/sequel/migrations/201608121657_create_entities_and_events.rb
94
+ - lib/sequel/migrations/201608231414_promote_by_and_at.rb
94
95
  - lib/tasks/entity_store.rake
95
96
  - spec/entity_store_sequel/postgres_entity_store_spec.rb
96
97
  - spec/entity_store_spec.rb