Skip to content

Latest commit

 

History

History
1 lines (1 loc) · 423 Bytes

File metadata and controls

1 lines (1 loc) · 423 Bytes

Imagine your model has a no-null constraint on some field in the database but doesn't have validates :email, presence: true validation. In that case, you're sure that you won't have null values in the database. But each attempt to save the nil value on that field will be rolled back with the error raised and without errors on your object. Mostly, you'd like to catch it properly and for that presence-validator exists.