paint-brush
Active Record Validations In Rails: How They Workby@dragonastronauts
118 reads

Active Record Validations In Rails: How They Work

by Dragon Astronauts3mMay 28th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

There are ways to bypass the callbacks and validations while still updating your database. Active record validations are a good place to start to prevent the funk. Sometimes you need to push the validations down to the database. Not every database constraint will provide value or even match perfectly with a model validation. The take away tip for where to start is go through your db/schema.rb and find columns that should either be null: false or have a default value and go write migrations for those.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Active Record Validations In Rails: How They Work
Dragon Astronauts HackerNoon profile picture
Dragon Astronauts

Dragon Astronauts

@dragonastronauts

A software company from Atlanta.

Learn More
LEARN MORE ABOUT @DRAGONASTRONAUTS'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Dragon Astronauts HackerNoon profile picture
Dragon Astronauts@dragonastronauts
A software company from Atlanta.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here
Buzzsumo
Coffee-web
Learnrepo
Iglob