From f9646c8a6312e8d2d5ecc5d35e6201a7f4fe00ba Mon Sep 17 00:00:00 2001 From: Mitch Crowe Date: Sat, 5 May 2012 18:34:54 -0700 Subject: [PATCH] SpawnMethods#merge returns the intersection when passed an array, and not the union. Update the documentation to reflect this. --- activerecord/lib/active_record/relation/spawn_methods.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb index 41e55dfd0e..f6d178db7a 100644 --- a/activerecord/lib/active_record/relation/spawn_methods.rb +++ b/activerecord/lib/active_record/relation/spawn_methods.rb @@ -7,7 +7,7 @@ module ActiveRecord module SpawnMethods # Merges in the conditions from other, if other is an ActiveRecord::Relation. - # Returns an array representing the union of the resulting records with other, if other is an array. + # Returns an array representing the intersection of the resulting records with other, if other is an array. # # ==== Examples # @@ -16,7 +16,7 @@ module ActiveRecord # # recent_posts = Post.order('created_at DESC').first(5) # Post.where(:published => true).merge(recent_posts) - # # Returns the union of all published posts with the 5 most recently created posts. + # # Returns the intersection of all published posts with the 5 most recently created posts. # # (This is just an example. You'd probably want to do this with a single query!) # def merge(other)