rescue ActiveRecord::RecordInvalid

Hi all,

I am using is_attachment plugin, but I will always end up with this

RuntimeError in PostsController#create

which was caused by:

version.filename = file_name_for_version(version_name)
   rescue ActiveRecord::RecordInvalid
  raise "BLAH"

RecordInvalid was raised by save! because is invalid.
Does anyone know why? I am uploading an image so it should validate

Any help would be most welcome

Hi Petan,

That's clearly not enough code to help you. What are the validations
on you version model?

Besides that it's good practice to not user save! but only save.

ciao, tom