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

Confreaks via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to build a flexible validation system that extends Rails' ActiveModel validators beyond traditional model classes in this 31-minute conference talk from RailsConf 2025. Discover how to validate Hash, Struct, and Data instances using Rails' built-in validation framework without creating full ActiveModel classes. Explore the construction of a single, generic validation class through test-driven development while examining ActiveModel validations and ActiveSupport callbacks source code. Master techniques for composing complex validation logic on-the-fly rather than registering them at the class level with complicated conditionals. Understand how to support both built-in and custom validators along with their various options like `if` and `allow_blank`. Apply these concepts to practical scenarios including validating JSON fields in models, ensuring proper formatting of incoming API requests, checking valid events in event-sourced applications, and running validators against third-party library classes without monkey-patching.

Syllabus

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

Taught by

Confreaks

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.