2019-10-26 07:36:04 +00:00
|
|
|
class AlbumUnprocess
|
|
|
|
include Mongoid::Document
|
|
|
|
field :image_id
|
|
|
|
field :save_var, type: String
|
|
|
|
field :upload_success, type: Boolean
|
|
|
|
def save_var
|
|
|
|
temp = YAML.load(self[:save_var])
|
|
|
|
temp[:tempfile] = File.open(temp[:tempfile])
|
|
|
|
ActionDispatch::Http::UploadedFile.new(temp)
|
|
|
|
end
|
|
|
|
def save_var=(value)
|
|
|
|
temp = {:filename => value.original_filename,
|
|
|
|
:type => value.content_type,
|
|
|
|
:head => value.headers,
|
|
|
|
:tempfile => value.tempfile.path}
|
|
|
|
self[:save_var] = temp.to_yaml
|
|
|
|
end
|
2019-10-23 05:54:31 +00:00
|
|
|
end
|