shrine-gridfs 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shrine/storage/gridfs.rb +8 -2
- data/shrine-gridfs.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b919da6ec801c8888bf1fbeb877cbdc8ad251d43
|
4
|
+
data.tar.gz: a3cbea2effb35eaee531176df0bcd533749bae62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf9beeb12753001aaf4366ecc0507ea450accd740994b9d28d9c31f4e94dba1c02f71668ebeb946692e5b29ad76feedb38b72ad53443c687fc5c1d87d24f569a
|
7
|
+
data.tar.gz: f668ac2435e9e46dc46b2e28eaa2fe37aa30cf80a716331901096f0175e71455e3b4773f6a74369c176a88c079ba3969f3e7c575bdde00bc8a617cf2989d7933
|
@@ -33,7 +33,13 @@ class Shrine
|
|
33
33
|
chunk.clear # deallocate string
|
34
34
|
end
|
35
35
|
|
36
|
-
files_collection.find(_id: file.id).update_one(
|
36
|
+
files_collection.find(_id: file.id).update_one(
|
37
|
+
"$set" => {
|
38
|
+
length: io.size,
|
39
|
+
uploadDate: Time.now.utc,
|
40
|
+
md5: file.info.md5.hexdigest,
|
41
|
+
}
|
42
|
+
)
|
37
43
|
end
|
38
44
|
|
39
45
|
def move(io, id, shrine_metadata: {}, **)
|
@@ -48,7 +54,7 @@ class Shrine
|
|
48
54
|
end
|
49
55
|
|
50
56
|
def open(id)
|
51
|
-
content_length = bucket.find(_id: bson_id(id)).first[
|
57
|
+
content_length = bucket.find(_id: bson_id(id)).limit(1).first[:length]
|
52
58
|
stream = bucket.open_download_stream(bson_id(id))
|
53
59
|
|
54
60
|
Down::ChunkedIO.new(
|
data/shrine-gridfs.gemspec
CHANGED