Group Repeated Options with with_options

When multiple validations share the same if: condition, or multiple callbacks share the same only: constraint, you end up repeating yourself. with_options groups them together. Instead of… …repeating conditions across multiple validations: class Article < ApplicationRecord validates :title , presence: true , if: :published? validates :body , length: { minimum: 100 }, if: :published? validates…