lib/paperclip-fedora.rb in paperclip-fedora-0.2.8 vs lib/paperclip-fedora.rb in paperclip-fedora-0.2.9
- old
+ new
@@ -42,14 +42,14 @@
end
def to_file(style=default_style)
return @queued_for_write[style.to_s] if @queued_for_write[style.to_s]
ds = fedora_object.datastreams[style.to_s]
- file = Tempfile.new([ds.label, style.to_s])
+ file = Tempfile.new([fedora_object.label, style.to_s])
file.binmode
- file.write(ds.file)
+ file.write(ds.read)
file.rewind
- return file
+ file
end
def flush_writes
@object_id = instance.uuid || @custom_pid || path()
@path = @object_id