making umask write out files so that the web server can read them

git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@137 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7
master
andrew 2008-02-05 01:39:59 +00:00
parent 2a9ce62c8a
commit af2050cede
1 changed files with 1 additions and 0 deletions

View File

@ -66,6 +66,7 @@ class Image < ActiveRecord::Base
# files if applicable.
#
def setup_directories
File.umask(0022)
Dir.mkdir(base_directory) unless File.exist?(base_directory)
self.original = File.basename(@file.original_filename).gsub(/[^\w._-]/, '')
@magick_image.write("#{base_directory}/#{self.original}")