entity_store 0.0.13 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,9 @@ module EntityStore
|
|
22
22
|
if value.respond_to?(:attributes)
|
23
23
|
value.attributes
|
24
24
|
elsif value.is_a?(Hash)
|
25
|
-
|
25
|
+
h = {}
|
26
|
+
value.each_pair do |k,v| h[k] = attribute_value(v) end
|
27
|
+
h
|
26
28
|
elsif value.is_a?(Array)
|
27
29
|
value.collect { |v| attribute_value(v) }
|
28
30
|
else
|
@@ -11,7 +11,7 @@ module EntityStore
|
|
11
11
|
|
12
12
|
def open_store
|
13
13
|
uri = URI.parse(EntityStore.connection_profile)
|
14
|
-
connection = Connection.from_uri(EntityStore.connection_profile, :connect_timeout => connect_timeout)
|
14
|
+
connection = Connection.from_uri(EntityStore.connection_profile, :connect_timeout => connect_timeout, :safe => true)
|
15
15
|
connection.db(uri.path.gsub(/^\//, ''))
|
16
16
|
end
|
17
17
|
|
@@ -28,8 +28,8 @@ module EntityStore
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def ensure_indexes
|
31
|
-
events.ensure_index([['
|
32
|
-
events.ensure_index([['
|
31
|
+
events.ensure_index([['_entity_id', Mongo::ASCENDING], ['_id', Mongo::ASCENDING]])
|
32
|
+
events.ensure_index([['_entity_id', Mongo::ASCENDING], ['entity_version', Mongo::ASCENDING], ['_id', Mongo::ASCENDING]])
|
33
33
|
end
|
34
34
|
|
35
35
|
def add_entity(entity)
|
data/lib/entity_store/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: entity_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mongo
|