Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Off the Rails - Validating Non-Model Classes with ActiveModel

Ruby Central via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Explore how to leverage Rails validators beyond traditional ActiveRecord models in this 31-minute conference talk from RailsConf 2025. Learn to build a flexible validation system that works with Hash, Struct, Data instances, and other non-model classes without creating heavyweight ActiveModel classes. Discover through test-driven development how to construct a single, generic class that accepts various argument types and enables on-the-fly composition of complex validation logic. Examine ActiveModel validations and ActiveSupport callbacks source code to understand how to support both built-in and custom validators with their full range of options including `if` and `allow_blank` conditions. Master practical applications such as validating JSON fields in models, ensuring proper API request formatting, checking valid events in event-sourced applications, and running validators against third-party library classes without monkey-patching. Gain insights into using Rails' classic validation features in innovative ways to solve modern development challenges while maintaining clean, maintainable code architecture.

Syllabus

RailsConf 2025 Off the Rails: Validating non-model classes with…ActiveModel? by Andy Andrea

Taught by

Ruby Central

Reviews

Start your review of Off the Rails - Validating Non-Model Classes with ActiveModel

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.