Rails 7.1 introduces the ability to call validate_constraint and validate_check_constraint within a change_table block. Previously, these methods had to be invoked outside the block, requiring constraint creation and validation as separate steps. This enhancement allows developers to write cleaner migrations by combining column

1m read timeFrom blog.saeloun.com
Post cover image
Table of contents
Before Rails 7.1After

Sort: