LibraryActive

Active Record Validations

Rails feature for validating Active Record objects before saving to the database.

Open source page

Product features

Product features

1. Migration Overview

2.1. Creating a Standalone Migration

2.2. Creating a New Table

2.3. Adding Columns

2.4. Removing Columns

2.5. Creating Associations

2.6. Other Generators that Create Migrations

2.7. Passing Modifiers

2. Generating Migration Files

3. Updating Migrations

Active Record Migrations

Chapters

format

Validates attributes against a regular expression.

length

Validates the length of attribute values.

numericality

Validates that attributes are numeric.

presence

Validates that specified attributes are not empty.

Strict Validations

Raises exceptions when validation fails.

uniqueness

Validates that the attribute value is unique.