attachment_fu icon indicating copy to clipboard operation
attachment_fu copied to clipboard

validates_as_attachment does not allow for custom error messages

Open vrinek opened this issue 15 years ago • 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

vrinek avatar Jun 25 '09 11:06 vrinek

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

darrenterhune avatar Mar 07 '10 04:03 darrenterhune