0

am new to Railway.js (one of those cases where someone else wrote this peace of software that I now need to update - great grr!)

I got a "Notification" model and want to add validation that if user don't provide a field from the UI I display a error like: "Message Required"

How do I do this?

Thank you!

Lennie
  • 1,999
  • 4
  • 27
  • 42

1 Answers1

0

refer to jugglingdb documentation. you need validator:

Notification.validatesPresenceOf('message')
Anatoliy
  • 29,485
  • 5
  • 46
  • 45
  • Where do I place this? Also I got Notification defined in db/schema.js but if I place above in the modules/notification.js it can't find the "Notification" object. – Lennie Dec 27 '12 at 07:47