Method: ActiveRecord::SchemaMigration#count

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

#countObject



91
92
93
94
95
96
97
98
# File 'activerecord/lib/active_record/schema_migration.rb', line 91

def count
  sm = Arel::SelectManager.new(arel_table)
  sm.project(*Arel::Nodes::Count.new([Arel.star]))

  @pool.with_connection do |connection|
    connection.select_values(sm, "#{self.class} Count").first
  end
end