Created
September 18, 2009 18:14
-
-
Save patrick99e99/189204 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def file_path | |
# -- I changed this line from: -- | |
# "#{directory_path}/#{id}.#{self.class.image_storage_format}" | |
"#{directory_path}/#{id}.#{self.server_format}" | |
end | |
def pre_save | |
if @uploaded_image | |
# perform preprocessing | |
perform_preprocess_operation | |
# Convert to storage format | |
# -- I removed this line: -- | |
# @uploaded_image.format = self.class.image_storage_format.to_s.upcase | |
# -- and replaced it with: -- | |
@uploaded_image.format = self.server_format | |
# Write image data to the DB field | |
if self.class.db_store? | |
self.image_file_data = @uploaded_image.to_blob | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment