From de732e0015b356507b7c3554bcce2aa8818626c7 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Tue, 13 Oct 2015 15:01:59 +0200 Subject: [PATCH] `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 --- .../lib/active_record/relation/query_methods.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index a2e4d6d1b5..660bb0899a 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -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 -- GitLab