Why this matters
Avoids drift and typos; a single edit updates all call sites.
When the same set of attribute/field names is used in multiple places (strong params, serializers, queries), extract it to a constant and reuse.
Avoids drift and typos; a single edit updates all call sites.
Side-by-side examples engineers can pattern-match during review.
params.require(:user).permit(:name, :email, :role)
User.select(:name, :email, :role)FIELDS = %i[name email role].freeze
params.require(:user).permit(*FIELDS)
User.select(*FIELDS)permit(:a, :b, :c) in many filesFIELDS = %i[a b c].freeze; permit(*FIELDS)From the same buckets as this rule.