method

count_with_associations

rails latest stable - Class: ActiveRecord::Associations::ClassMethods

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1.1.6) is shown here.

count_with_associations(options = {})
private

No documentation available.

# File activerecord/lib/active_record/associations.rb, line 969
        def count_with_associations(options = {})
          catch :invalid_query do
            join_dependency = JoinDependency.new(self, merge_includes(scope(:find, :include), options[:include]), options[:joins])
            return count_by_sql(construct_counter_sql_with_included_associations(options, join_dependency))
          end
          0
        end