attach 1.1.1 → 1.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab0fc9f1044d78e6529a8acdc8654ca635831cc07bec62f3ec6315e9a6b96814
4
- data.tar.gz: 5bfa0ce4d4c3d85c7d9435dbbfaa2170774dd8e74cd5483c5ee0b3560760f4be
3
+ metadata.gz: 1b8c3f1129d2c35650ecb7d9b0c137d20a6a2265f2304c5976b4d4dfc252ee15
4
+ data.tar.gz: ac3a03c541d799dcae47442d84fd47249ec257d2566da242d6e8d4d09ad8b0e2
5
5
  SHA512:
6
- metadata.gz: 2b364cb5e049f26116a11cf2d7c8c6a44b53f35ad26a6665c9e2f59937792549537607da7a7dff9b4bc5aab91224252a5495315abbcb10fe3511043032b28600
7
- data.tar.gz: 97c06bb92c31f0e6f6c9fee505118dddd9c4626a9419de7760f8fb96944fea36618b8da1d4e55ee0656427cb7dce90429d8d384c1303096cda29aaa5beaf343c
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
- binary = AttachmentBinary.where(:attachment_id => attachment.id).first_or_initialize
16
+ binary_object = AttachmentBinary.where(:attachment_id => attachment.id).first_or_initialize
17
17
  if binary.respond_to?(:path)
18
18
  binary.rewind
19
- binary.data = binary.read
19
+ binary_object.data = binary.read
20
20
  else
21
- binary.data = binary
21
+ binary_object.data = binary
22
22
  end
23
- binary.save!
23
+ binary_object.save!
24
+ binary_object
24
25
  end
25
26
 
26
27
  def delete(attachment)
@@ -1,3 +1,3 @@
1
1
  module Attach
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attach
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke