Skip to content

Commit

Permalink
Merge pull request technoweenie#12 from benstein/patch-1
Browse files Browse the repository at this point in the history
Check for nil filename
  • Loading branch information
pothoven committed Apr 27, 2015
2 parents 4f9fb7c + 1b5b63f commit c4c8921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/technoweenie/attachment_fu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def with_image(&block)
# Generates a unique filename for a Tempfile.
def random_tempfile_filename
base_filename = filename ? filename.gsub(/\.\w+$/, '') : 'attachment'
ext = filename.slice(/\.\w+$/)
ext = filename ? filename.slice(/\.\w+$/) : ''
["#{rand Time.now.to_i}#{base_filename}", ext || '']
end

Expand Down

0 comments on commit c4c8921

Please sign in to comment.