Read-Only Tracking Not Disabled (ARCH6054)
Esta página aún no está disponible en tu idioma.
Key ruby.orm.readonly-tracking-not-disabled · Severity warning · Category orm
Loading read-only records as fully hydrated, tracked objects adds memory and identity-map overhead. In ActiveRecord readonly or pluck is lighter.
Incorrect
Section titled “Incorrect”emails = User.where(active: true).map(&:email) # full tracked objectsCorrect
Section titled “Correct”emails = User.where(active: true).pluck(:email) # column value onlyUse pluck or readonly on read-only queries to avoid needless object hydration.