تخطَّ إلى المحتوى

Read-Only Tracking Not Disabled (ARCH6054)

هذا المحتوى غير متوفر بلغتك بعد.

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.

emails = User.where(active: true).map(&:email) # full tracked objects
emails = User.where(active: true).pluck(:email) # column value only

Use pluck or readonly on read-only queries to avoid needless object hydration.