Method: ActiveRecord::ModelSchema::ClassMethods#content_columns

Defined in:
activerecord/lib/active_record/model_schema.rb

#content_columnsObject

Returns an array of column objects where the primary id, all columns ending in “_id” or “_count”, and columns used for single table inheritance have been removed.



489
490
491
492
493
494
495
# File 'activerecord/lib/active_record/model_schema.rb', line 489

def content_columns
  @content_columns ||= columns.reject do |c|
    c.name == primary_key ||
    c.name == inheritance_column ||
    c.name.end_with?("_id", "_count")
  end.freeze
end