~/talk

Validate Me! - Demystifying Rails Validators

Talkat Blue Ridge Ruby 2024 · 2024-05-30..05-31· [ruby-on-rails]
slides:none on file

Shows that ComparisonValidator merged into Rails and that custom validators can live in app, lib, gem, or Rails itself; explains validators registered via validates/validates_with into model._validators but run later via valid/save callbacks; details options like allow_nil, allow_blank, message, if/unless, on, strict; highlights that validators live in ActiveModel not ActiveRecord so uniqueness validator has race conditions and DB constraints still require unique indexes; demonstrates how to implement validate_each.

AI-written summary · about

  1. 0:00Rails validators intro
  2. 1:08Standard validator helpers
  3. 3:38Presence validator deep dive
  4. 6:22Active Model vs Active Record
  5. 8:51Standard library validators
  6. 10:59Validations and database
  7. 12:24How validates method works
  8. 14:49When validations trigger
  9. 16:37Purpose and limits of validations
  10. 18:43Custom validators in Rails
  11. 21:11Where to place custom validators
  12. 23:17Acknowledgments
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.