simply_stored 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/simply_stored.rb +1 -1
- data/lib/simply_stored/couch/finders.rb +3 -3
- data/test/soft_deletable_test.rb +2 -0
- metadata +3 -3
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.5.
|
7
|
+
VERSION = '0.5.3'
|
8
8
|
class Error < RuntimeError; end
|
9
9
|
class RecordNotFound < RuntimeError; end
|
10
10
|
end
|
@@ -15,13 +15,13 @@ module SimplyStored
|
|
15
15
|
if with_deleted || !soft_deleting_enabled?
|
16
16
|
CouchPotato.database.view(all_documents(*args))
|
17
17
|
else
|
18
|
-
CouchPotato.database.view(all_documents_without_deleted(options))
|
18
|
+
CouchPotato.database.view(all_documents_without_deleted(options.update(:include_docs => true)))
|
19
19
|
end
|
20
20
|
when :first
|
21
21
|
if with_deleted || !soft_deleting_enabled?
|
22
|
-
CouchPotato.database.view(all_documents(:limit => 1)).first
|
22
|
+
CouchPotato.database.view(all_documents(:limit => 1, :include_docs => true)).first
|
23
23
|
else
|
24
|
-
CouchPotato.database.view(all_documents_without_deleted(:limit => 1)).first
|
24
|
+
CouchPotato.database.view(all_documents_without_deleted(:limit => 1, :include_docs => true)).first
|
25
25
|
end
|
26
26
|
else
|
27
27
|
raise SimplyStored::Error, "Can't load record without an id" if what.nil?
|
data/test/soft_deletable_test.rb
CHANGED
@@ -273,7 +273,9 @@ class SoftDeletableTest < Test::Unit::TestCase
|
|
273
273
|
should "load non-deleted" do
|
274
274
|
hemorrhoid = Hemorrhoid.create
|
275
275
|
assert_not_nil Hemorrhoid.find(:first)
|
276
|
+
assert Hemorrhoid.find(:first).is_a?(Hemorrhoid), Hemorrhoid.find(:first).inspect
|
276
277
|
assert_not_nil Hemorrhoid.find(:first, :with_deleted => false)
|
278
|
+
assert Hemorrhoid.find(:first, :with_deleted => false).is_a?(Hemorrhoid), Hemorrhoid.find(:first, :with_deleted => false).inspect
|
277
279
|
end
|
278
280
|
|
279
281
|
should "load deleted if asked to" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simply_stored
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 3
|
10
|
+
version: 0.5.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mathias Meyer, Jonathan Weiss
|