Writing
freeCodeCamp·Jul 2019·7 min read

Rails: How to Set a Unique Interchangeable Index Constraint

Model-level uniqueness validation gives you a nice error message, but it doesn't guarantee integrity. How to enforce an interchangeable unique constraint at the database level in Rails.

Model-level uniqueness validation gives you a nice error message, but it doesn't guarantee integrity. How to enforce an interchangeable unique constraint at the database level in Rails.

This piece is published with freeCodeCamp.

Read the full article on freeCodeCamp