Displaying 4 results from an estimated 4 matches for "queued_for_writ".
Did you mean:
queued_for_write
2009 Oct 03
2
Looking for a good resource on open-uri and FileUtils
...inal_filename
File.exist?(path(style))
else
false
end
end
# Returns representation of the data of the file assigned to the
given
# style, in the format most representative of the current storage.
def to_file style = default_style
@queued_for_write[style] || (File.new(path(style)) if
exists?(style))
end
alias_method :to_io, :to_file
def flush_writes #:nodoc:
@queued_for_write.each do |style, file|
FileUtils.mkdir_p(File.dirname(path(style)))
result = file.stream_to(path(style))
file.cl...
2009 Jul 07
2
paperclip unit testing
Hi,
Rails 2.3.2, paperclip 2.2.9.2
How can I unit test my model that has a paperclip attachment?
I add to my model:
--- CODE START ---
has_attached_file :image, :default_url => ''''
attr_protected :image_file_name, :image_content_type, :image_image_size
--- CODE END ---
Than I type a UNIT test:
--- CODE START ---
foo=FooModel.new({:image =>
2010 Aug 22
0
Paperclip - possible to modify file and load file content as string?
Wanted to see if anyone knows of a way - or the preferred way - to do these
three tasks with Paperclip:
1) Access the content of an uploaded file before save. I did find that the
following works before save, but is there a clearer way to do this:
self.uploaded_file.queued_for_write[:original].open.read
2) Access the content of a file after save while my AR model instance is
still alive and/or when I load a record and need the file content. i.e. do I
just need to manually read the file into my object from the Paperclip path,
or is there a direct method in Paperclip to do thi...
2012 Jul 07
18
Problem processing text file after uploading
I''ve got a web-app currently partially working. The user uploads a .txt,
.docx or .doc file to the server.
Currently the model handles those files, saves some metadata (the
extention and orig filename) then saves the file to the hard drive. Next
it converts the doc and docx files to plain text and saves the output to
a txt file.
My problem is I want to copy the plain text contents of