volt 0.7.16 → 0.7.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d17a25b618219092d2e72f692003624d383c9df0
4
- data.tar.gz: 05b12f783903823cbfacfe7240e8aa2ff8937b90
3
+ metadata.gz: 9239ba9984089cff5785b60306dc79864f71ff0e
4
+ data.tar.gz: cf68443c2f05b2e18bc0e73f984955bb1c54b9d1
5
5
  SHA512:
6
- metadata.gz: 65b02212fb4a0828733befc8d468e818d79c8d6b2c14ea2e9ba45a0f16f5bcefc9cd6695d4f941e2f2adacaa27471b2c7148c87f0a868999e4aa49a597979405
7
- data.tar.gz: cfad36f2b29abc2b922217721a624cccb7d81b1adbfa45e73ddff4408e910c09da2d7808d3f698f28045e653290ef138bce4689bcdc8d8b0336196cd96ff5224
6
+ metadata.gz: 8efe0fb7ced6b42882aaf5ef287fdbb0517404892bbf9057c6beb2c3bb5fdb8dea330d308184313fc1e28f6b45d64c9c8550b3b040c09d9c8e357ff1dcfe3d0f
7
+ data.tar.gz: f79c94e9a44b00f04decbc9c8c8913146581ef7a3a3782f62f77db13a39f492cef35000f4982faee831cebc3003d23e9563ee8884d63db9e6d4070f252c8db45
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.16
1
+ 0.7.17
@@ -7,6 +7,15 @@ class DataStore
7
7
  end
8
8
 
9
9
  def query(collection, query)
10
+ puts "QUERY: #{collection} - #{query.inspect}"
11
+
12
+ query = query.dup
13
+ query.keys.each do |key|
14
+ if key =~ /_id$/
15
+ query[key] = BSON::ObjectId(query[key])
16
+ end
17
+ end
18
+
10
19
  @@db[collection].find(query).to_a
11
20
  end
12
21
  end
@@ -53,7 +53,11 @@ class LiveQuery
53
53
 
54
54
  # return the query results the first time a channel connects
55
55
  def initial_data
56
- @query_tracker.results.map.with_index {|data, index| [index, data] }
56
+ @query_tracker.results.map.with_index do |data, index|
57
+ data = data.dup
58
+ data['_id'] = data['_id'].to_s
59
+ [index, data]
60
+ end
57
61
  end
58
62
 
59
63
  def add_channel(channel)
@@ -36,7 +36,10 @@ class QueryTasks
36
36
  end
37
37
 
38
38
  def initial_data
39
- return live_query.initial_data
39
+ data = live_query.initial_data
40
+ data['_id'] = data['_id'].to_s
41
+
42
+ return data
40
43
  end
41
44
 
42
45
  # Remove a listening channel, the LiveQuery will automatically remove
@@ -105,8 +105,10 @@ class EachBinding < BaseBinding
105
105
  @removed_listener.remove
106
106
  @removed_listener = nil
107
107
 
108
- @templates.each(&:remove)
109
- @templates = nil
108
+ if @templates
109
+ @templates.compact.each(&:remove)
110
+ @templates = nil
111
+ end
110
112
 
111
113
  super
112
114
  end
@@ -46,7 +46,7 @@ class Tasks
46
46
  if callback
47
47
  if error
48
48
  # TODO: full error handling
49
- puts "Error: #{error.inspect}"
49
+ puts "Error2: #{error.inspect}"
50
50
  else
51
51
  callback.call(result)
52
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.16
4
+ version: 0.7.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stout
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-26 00:00:00.000000000 Z
11
+ date: 2014-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor