35% Off Finance Skills That Get You Hired - Code CFI35
AI Adoption - Drive Business Value and Organizational Impact
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