Validations & Callbacks on different events in Ruby ⚓️
1 min readApr 21, 2019
Validations
They are used to ensure that only valid data is saved into your database. i.e. check user email presence, check email uniqueness etc.
Callback
They are methods that get called at certain moments of an object’s life cycle. With callbacks it is possible to write code that will run whenever an object is created, saved, updated, deleted, validated, or loaded from the database.