🎓 ApplicationRecord toggle Oct 21, 2022 #TIL #ruby_on_rails https://t.co/eTkhjcTftM A nice little helper to switch a boolean attribute 👌 There is also toggle! which will update the field in the database. class Bookmark < ApplicationRecord def toggle_read toggle(:read) end def toggle_read! toggle!(:read) end end