Method: ActiveRecord::InternalMetadata#count
- Defined in:
- activerecord/lib/active_record/internal_metadata.rb
#count ⇒ Object
65 66 67 68 69 70 71 72 |
# File 'activerecord/lib/active_record/internal_metadata.rb', line 65 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 |