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 CHANGED
@@ -1,6 +1,10 @@
1
1
  Changelog
2
2
  =============
3
3
 
4
+ 0.3.3
5
+
6
+ - Fix association counting bug
7
+
4
8
  - Introduce :ignore option to has_many :dependent option. If :dependent is set to :ignore,
5
9
  dependent objects will not be deleted or nullified but just ignored.
6
10
 
@@ -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], null);
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 = <<-eos
20
- function(key, values) {
21
- return values.length;
22
- }
23
- eos
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], null);
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.2'
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
- - 2
9
- version: 0.3.2
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-14 00:00:00 +02:00
17
+ date: 2010-05-19 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency