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:
parent
b7e3f3c7c4
commit
f9646c8a63
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue