40% Off All Coursera Courses
PowerBI Data Analyst - Create visualizations and dashboards from scratch
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