diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-01-14 14:45:41 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-01-14 14:49:43 +0000 |
commit | 07121bf22b0929e03215f02b8740c3979ae6c872 (patch) | |
tree | 4df8810a8120ee6ee1f439443508d8cf18c86171 /app/models | |
parent | 285c2b7836b49db196a2fde4ba9fbe851c403882 (diff) |
As we're validating filename with validates_presence_of, which doesn't allow blanks, ensure_filename! should populate a default filename on a blank filename, as well as on nil.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/foi_attachment.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb index a40898aef..2d3cce93a 100644 --- a/app/models/foi_attachment.rb +++ b/app/models/foi_attachment.rb @@ -205,7 +205,7 @@ class FoiAttachment < ActiveRecord::Base def ensure_filename! - if self.filename.nil? + if self.filename.blank? calc_ext = AlaveteliFileTypes.mimetype_to_extension(self.content_type) if !calc_ext calc_ext = "bin" |