Permalink
Browse files

Consistency when using Relation constants

  • Loading branch information...
lifo committed Apr 2, 2010
1 parent 30f3a3d commit bc7da9b77d6347eeccefa2c735b2f236a08eea57
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/relation/spawn_methods.rb
@@ -6,7 +6,7 @@ def merge(r)
merged_relation = clone
return merged_relation unless r
- (ActiveRecord::Relation::ASSOCIATION_METHODS + ActiveRecord::Relation::MULTI_VALUE_METHODS).reject {|m| [:joins, :where].include?(m)}.each do |method|
+ (Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS).reject {|m| [:joins, :where].include?(m)}.each do |method|
unless (value = r.send(:"#{method}_values")).blank?
merged_relation.send(:"#{method}_values=", value)
end
@@ -26,7 +26,7 @@ def merge(r)
merged_relation.where_values = merged_wheres
- ActiveRecord::Relation::SINGLE_VALUE_METHODS.reject {|m| m == :lock}.each do |method|
+ Relation::SINGLE_VALUE_METHODS.reject {|m| m == :lock}.each do |method|
unless (value = r.send(:"#{method}_value")).nil?
merged_relation.send(:"#{method}_value=", value)
end

0 comments on commit bc7da9b

Please sign in to comment.