mongo_light 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mongo_light/document.rb +4 -8
- data/lib/mongo_light/version.rb +1 -1
- metadata +2 -2
data/lib/mongo_light/document.rb
CHANGED
|
@@ -15,14 +15,10 @@ module MongoLight
|
|
|
15
15
|
found.nil? ? nil : self.new(unmap(found))
|
|
16
16
|
end
|
|
17
17
|
def find_one(selector = {}, opts={})
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if opts.delete(:raw)
|
|
23
|
-
return unmap(found, true)
|
|
24
|
-
end
|
|
25
|
-
self.new(unmap(found))
|
|
18
|
+
raw = opts.delete(:raw) || false
|
|
19
|
+
found = collection.find_one(map(selector), map_options(opts))
|
|
20
|
+
return nil if found.nil?
|
|
21
|
+
return raw ? unmap(found, true) : self.new(unmap(found))
|
|
26
22
|
end
|
|
27
23
|
def find(selector={}, opts={}, collection = nil)
|
|
28
24
|
raw = opts.delete(:raw) || false
|
data/lib/mongo_light/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mongo_light
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
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: 2011-10
|
|
12
|
+
date: 2011-11-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies: []
|
|
14
14
|
description:
|
|
15
15
|
email:
|