提交 de732e00 编写于 作者: Y Yves Senn

`private def` breaks RDoc. Move meathod to preserve the docs.

The rdoc parser seems to trip on the `private def` construct.
Public methods following a method defined with `private def` are not
visible inside the module docs but are appended to the top-most module.

For example the method `ActiveRecord::QueryMethods#distinct` was listed
under `ActiveRecord#distinct`.

/cc @sgrif
上级 718468e1
......@@ -604,12 +604,6 @@ def or!(other) # :nodoc:
self
end
private def structurally_compatible_for_or?(other) # :nodoc:
Relation::SINGLE_VALUE_METHODS.all? { |m| send("#{m}_value") == other.send("#{m}_value") } &&
(Relation::MULTI_VALUE_METHODS - [:extending]).all? { |m| send("#{m}_values") == other.send("#{m}_values") } &&
(Relation::CLAUSE_METHODS - [:having, :where]).all? { |m| send("#{m}_clause") != other.send("#{m}_clause") }
end
# Allows to specify a HAVING clause. Note that you can't use HAVING
# without also specifying a GROUP clause.
#
......@@ -1095,6 +1089,12 @@ def check_if_method_has_arguments!(method_name, args)
end
end
def structurally_compatible_for_or?(other)
Relation::SINGLE_VALUE_METHODS.all? { |m| send("#{m}_value") == other.send("#{m}_value") } &&
(Relation::MULTI_VALUE_METHODS - [:extending]).all? { |m| send("#{m}_values") == other.send("#{m}_values") } &&
(Relation::CLAUSE_METHODS - [:having, :where]).all? { |m| send("#{m}_clause") != other.send("#{m}_clause") }
end
def new_where_clause
Relation::WhereClause.empty
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册