technoweenie/attachment_fu

validates_as_attachment does not allow for custom error messages

vrinek opened this issue · 1 comments

validates_as_attachment replaced validates_attachment but the former seems to not have support for custom error messages (which we use for other languages)

this a workaround I use: http://gist.github.com/135810

Why don't you use the validate method, which gets ran instead of using a call back method.

example:

def validate
  errors.add_to_base("Filename is blank") if self.filename == nil
end