Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Unlock the secrets of Rails validators in this enlightening session. Ever wondered what's really happening behind the scenes? Join us as we delve deep into the inner workings of Rails validators, unravel their hidden complexities, and empower you to craft your own custom validators with confidence! ___________________________________________________________________________ Rachael has been a software engineer since 2012, 3x team lead, and enjoys livestreaming her open-source contributions on Twitch. She added the ComparisonValidator to Rails, built the Jekyll-Twitch gem, and is working on an app for making friends at conferences.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the presentation titled "Validate Me! - Demystifying Rails Validators," Rachael Wright Munn explores the intricacies of validation within Rails applications. The session targets engineers of varying skill levels at the Blue Ridge Ruby 2024 conference, focusing on how Rails validators work and how to create custom validators effectively. Rachael begins with a brief introduction of her qualifications, including the addition of the ComparisonValidator to Rails, before diving into the main topic. **Key Points Discussed:** - **Nature of Validators**: Rachael emphasizes the role of validators in ensuring that specific attributes within a Rails model meet certain criteria, using examples such as the presence validator and the comparison validator. - **Structure of Validations**: Validators in Rails inherit from Active Model, which maintains consistency across the framework. Each validator implements a method called `validate_each`, which handles error reporting when conditions are unmet. - **Active Model vs Active Record**: Rachael distinguishes between Active Model, which deals with Ruby objects and validates them without recognizing the database, and Active Record, which manages database interactions. - **Concurrency Issues**: An important point discussed was the limitations of validators in protecting the database, particularly with the uniqueness validator, which can lead to concurrency issues without proper database constraints. - **Creating Custom Validators**: Rachael provides detailed guidance on developing custom validators, outlining where they can reside (models, lib directory, or as a gem) and the process required to add them to Rails. She highlights the importance of following naming conventions, inheriting from Active Model validators, and implementing the `validate_each` method. In conclusion, Rachael encourages engineers to innovate with their custom validators, emphasizing the long-term commitment required to contribute to Rails, as evidenced by her own year-long journey to integrate the ComparisonValidator. She expresses gratitude to the conference organizers and offers the audience the opportunity to ask questions after her talk, reinforcing her open, engaging presentation style.
Suggest modifications
Cancel