fclay 0.1.33 → 0.1.34
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 +4 -4
- data/lib/fclay/attachment.rb +3 -4
- data/lib/fclay/version.rb +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: 2a01b156202b0dfa22a1fdeccd361fd067e31711
|
|
4
|
+
data.tar.gz: 0ed02b2adde1f83dd6ff6da6fe0ad9e5ce928e8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 49a9f11382857e8e4ca85dc68489ab0c0559106f3e0f98baf2fb0e5d787ff3e47f9d85821e117299c800d5be5ae44577e6749112e89acb3732c71c26a8941db2
|
|
7
|
+
data.tar.gz: 6cc0a75dfa6e0c8c7725df481ebe29e1bf77313436db2b377ebf8ac9f39381b4bdff09190f0b64723a69c7e2f432d6dd112c5822491d22afe5155cb73a7f6cdd
|
data/lib/fclay/attachment.rb
CHANGED
|
@@ -57,16 +57,15 @@ module Fclay
|
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def self.upload type,id
|
|
60
|
-
self.try(:log,"upload('#{type}',#{id}) called")
|
|
61
60
|
type = type.safe_constantize
|
|
62
61
|
return unless type
|
|
63
62
|
uploading_object = type.find_by_id(id)
|
|
64
|
-
|
|
63
|
+
uploading_object.try(:log,"uploading_object: #{uploading_object} uploading_object.need_upload: #{uploading_object.need_upload}")
|
|
65
64
|
return if !uploading_object || !uploading_object.need_upload
|
|
66
65
|
content_type = uploading_object.try(:content_type)
|
|
67
66
|
bucket = Fclay.remote_storage.bucket_object
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
uploading_object.try(:log,"Start uploading")
|
|
70
69
|
(uploading_object.class.fclay_options[:styles] || [nil]).each do |style|
|
|
71
70
|
obj = bucket.object(uploading_object.remote_file_path(style))
|
|
72
71
|
obj.put({
|
|
@@ -77,7 +76,7 @@ module Fclay
|
|
|
77
76
|
end
|
|
78
77
|
|
|
79
78
|
type.where(:id => id).update_all(:file_status => 'idle', :file_location => Fclay.remote_storage.name)
|
|
80
|
-
|
|
79
|
+
uploading_object.try(:log,"Sucessful uploaded! file_status: 'idle', file_location: #{Fclay.remote_storage.name}")
|
|
81
80
|
uploading_object.delete_local_files
|
|
82
81
|
uploading_object.try(:uploaded)
|
|
83
82
|
|
data/lib/fclay/version.rb
CHANGED