0
@@ -724,6 +724,8 @@ module ActiveRecord
0
# Specify second-order associations that should be eager loaded when the collection is loaded.
0
# An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
0
+ # Combined with +:group+ this can be used to filter the records that a <tt>GROUP BY</tt> returns. Uses the <tt>HAVING</tt> SQL-clause.
0
# An integer determining the limit on the number of rows that should be returned.
0
@@ -1181,6 +1183,8 @@ module ActiveRecord
0
# Specify second-order associations that should be eager loaded when the collection is loaded.
0
# An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
0
+ # Combined with +:group+ this can be used to filter the records that a <tt>GROUP BY</tt> returns. Uses the <tt>HAVING</tt> SQL-clause.
0
# An integer determining the limit on the number of rows that should be returned.
0
@@ -1553,7 +1557,7 @@ module ActiveRecord
0
@@valid_keys_for_has_many_association = [
0
:class_name, :table_name, :foreign_key, :primary_key,
0
- :select, :conditions, :include, :order, :group, :
limit, :offset,
0
+ :select, :conditions, :include, :order, :group, :
having, :limit, :offset,
0
:as, :through, :source, :source_type,
0
:finder_sql, :counter_sql,
0
@@ -1609,7 +1613,7 @@ module ActiveRecord
0
mattr_accessor :valid_keys_for_has_and_belongs_to_many_association
0
@@valid_keys_for_has_and_belongs_to_many_association = [
0
:class_name, :table_name, :join_table, :foreign_key, :association_foreign_key,
0
- :select, :conditions, :include, :order, :group, :
limit, :offset,
0
+ :select, :conditions, :include, :order, :group, :
having, :limit, :offset,
0
:finder_sql, :counter_sql, :delete_sql, :insert_sql,
0
:before_add, :after_add, :before_remove, :after_remove,
0
@@ -1658,7 +1662,7 @@ module ActiveRecord
0
add_conditions!(sql, options[:conditions], scope)
0
add_limited_ids_condition!(sql, options, join_dependency) if !using_limitable_reflections?(join_dependency.reflections) && ((scope && scope[:limit]) || options[:limit])
0
- add_group!(sql, options[:group],
scope)
0
+ add_group!(sql, options[:group],
options[:having], scope)
0
add_order!(sql, options[:order], scope)
0
add_limit!(sql, options, scope) if using_limitable_reflections?(join_dependency.reflections)
0
add_lock!(sql, options, scope)
0
@@ -1714,7 +1718,7 @@ module ActiveRecord
0
add_conditions!(sql, options[:conditions], scope)
0
- add_group!(sql, options[:group],
scope)
0
+ add_group!(sql, options[:group],
options[:having], scope)
0
if order && is_distinct
0
connection.add_order_by_for_association_limiting!(sql, :order => order)