1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

SpawnMethods#merge returns the intersection when passed an array, and not the union. Update the documentation to reflect this.

This commit is contained in:
Mitch Crowe 2012-05-05 18:34:54 -07:00
parent b7e3f3c7c4
commit f9646c8a63

View file

@ -7,7 +7,7 @@ module ActiveRecord
module SpawnMethods
# Merges in the conditions from <tt>other</tt>, if <tt>other</tt> is an <tt>ActiveRecord::Relation</tt>.
# Returns an array representing the union of the resulting records with <tt>other</tt>, if <tt>other</tt> is an array.
# Returns an array representing the intersection of the resulting records with <tt>other</tt>, if <tt>other</tt> 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)