Free courses from frontend to fullstack and AI
Google AI Professional Certificate - Learn AI Skills That Get You Hired
Overview
Google, IBM & Meta Certificates — All 10,000+ Courses at 40% Off
One annual plan covers every course and certificate on Coursera. 40% off for a limited time.
Get Full Access
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