simply_stored 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/simply_stored/couch/belongs_to.rb +8 -7
- data/lib/simply_stored.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
@@ -10,17 +10,18 @@ module SimplyStored
|
|
10
10
|
if (doc['#{soft_delete_attribute}'] && doc['#{soft_delete_attribute}'] != null){
|
11
11
|
// "soft" deleted
|
12
12
|
}else{
|
13
|
-
emit([doc.#{name.to_s}_id, doc.created_at],
|
13
|
+
emit([doc.#{name.to_s}_id, doc.created_at], 1);
|
14
14
|
}
|
15
15
|
}
|
16
16
|
}
|
17
17
|
eos
|
18
18
|
|
19
|
-
reduce_definition =
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
reduce_definition = "_sum"
|
20
|
+
# reduce_definition = <<-eos
|
21
|
+
# function(key, values) {
|
22
|
+
# return sum(values);
|
23
|
+
# }
|
24
|
+
# eos
|
24
25
|
|
25
26
|
view "association_#{self.name.underscore}_belongs_to_#{name}",
|
26
27
|
:map => map_definition_without_deleted,
|
@@ -31,7 +32,7 @@ module SimplyStored
|
|
31
32
|
map_definition_with_deleted = <<-eos
|
32
33
|
function(doc) {
|
33
34
|
if (doc['ruby_class'] == '#{self.to_s}' && doc['#{name.to_s}_id'] != null) {
|
34
|
-
emit([doc.#{name.to_s}_id, doc.created_at],
|
35
|
+
emit([doc.#{name.to_s}_id, doc.created_at], 1);
|
35
36
|
}
|
36
37
|
}
|
37
38
|
eos
|
data/lib/simply_stored.rb
CHANGED
@@ -4,7 +4,7 @@ require File.expand_path(File.dirname(__FILE__) + '/simply_stored/storage')
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + '/simply_stored/class_methods_base')
|
5
5
|
|
6
6
|
module SimplyStored
|
7
|
-
VERSION = '0.3.
|
7
|
+
VERSION = '0.3.3'
|
8
8
|
class Error < RuntimeError; end
|
9
9
|
class RecordNotFound < RuntimeError; end
|
10
10
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 3
|
9
|
+
version: 0.3.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Mathias Meyer, Jonathan Weiss
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-19 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|