π ApplicationRecord toggleOct 21, 2022#TIL#ruby_on_railshttps://t.co/eTkhjcTftMA 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