vivesvoies / court-message

Permettre aux CNFS de communiquer avec les gens qu’ils accompagnent.
0 stars 0 forks source link

Empty message create an ActiveRecord::RecordInvalid error #264

Open alallema opened 3 months ago

alallema commented 3 months ago

What happens:

If an empty message is send an error is through. See Sentry report

Error:

ActiveRecord::RecordInvalid
La validation a échoué : Messages n'est pas valide (ActiveRecord::RecordInvalid)

Possible solutions:

It would be better to check this beforehand than to be stopped by this condition: validates_presence_of :content