attach 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/attach/backends/database.rb +5 -4
- data/lib/attach/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b8c3f1129d2c35650ecb7d9b0c137d20a6a2265f2304c5976b4d4dfc252ee15
|
4
|
+
data.tar.gz: ac3a03c541d799dcae47442d84fd47249ec257d2566da242d6e8d4d09ad8b0e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6195ce53ff7b626f3051448e00c8ebec9cbca5dd715c728bcc68052e1ec54753fc65d31c3f4cced08bfc04a0768672191921dbe3620299848b0a8688e82e082d
|
7
|
+
data.tar.gz: 8a877be8bac066f7fa36ab33f81481c38aa15f96f63df7f3c9462ee256ec97ed650c116b74a7598cd34d6be458e9fca2b1ba9c35c5fcbfa42a9933cbc6b543fe
|
@@ -13,14 +13,15 @@ module Attach
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def write(attachment, binary)
|
16
|
-
|
16
|
+
binary_object = AttachmentBinary.where(:attachment_id => attachment.id).first_or_initialize
|
17
17
|
if binary.respond_to?(:path)
|
18
18
|
binary.rewind
|
19
|
-
|
19
|
+
binary_object.data = binary.read
|
20
20
|
else
|
21
|
-
|
21
|
+
binary_object.data = binary
|
22
22
|
end
|
23
|
-
|
23
|
+
binary_object.save!
|
24
|
+
binary_object
|
24
25
|
end
|
25
26
|
|
26
27
|
def delete(attachment)
|
data/lib/attach/version.rb
CHANGED