Get 20% off all career paths from fullstack to AI
Power BI Fundamentals - Create visualizations and dashboards from scratch
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
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