activerecord/lib/active_record/associations/collection_association.rb
# Implements the ids reader method, e.g. foo.item_ids for Foo.has_many :items
Implements the ids reader method, e.g.
Implements the ids reader method e . g .
def ids_reader
        if loaded?
          load_target.map do |record|
            record.send(reflection.association_primary_key)
          end
        else
          @association_ids ||= (
            column = "#{reflection.quoted_table_name}.#{reflection.association_primary_key}"
            scope.pluck(column)
          )
        end
      end
def ids_reader if loaded? load_target . map do | record | record . send ( reflection . association_primary_key ) end else @association_ids ||= ( column = "#{reflection.quoted_table_name}.#{reflection.association_primary_key}" scope . pluck ( column ) ) end end
Implements the ids reader method, e.g.
Implements the ids reader method e . g .