aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2015-10-13 15:01:59 +0200
committerYves Senn <yves.senn@gmail.com>2015-10-13 15:05:39 +0200
commitde732e0015b356507b7c3554bcce2aa8818626c7 (patch)
treee21fd4acbffb6c54ce8fb4b82518ee9282d14863 /activerecord
parent718468e1c9666ee8d58ae2a446e865a1e1e1fc4e (diff)
downloadrails-de732e0015b356507b7c3554bcce2aa8818626c7.tar.gz
rails-de732e0015b356507b7c3554bcce2aa8818626c7.tar.bz2
rails-de732e0015b356507b7c3554bcce2aa8818626c7.zip
`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
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb12
1 files 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 @@ module ActiveRecord
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 @@ module ActiveRecord
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