merge(other)
Instance Public methods
Merges in the conditions from other, if other is
an ActiveRecord::Relation. Returns an array representing the
intersection of the resulting records with other, if
other is an array.
Post.where(published: true).joins(:comments).merge( Comment.where(spam: false) )
# Performs a single join query with both where conditions.
recent_posts = Post.order('created_at DESC').first(5)
Post.where(published: true).merge(recent_posts)
# Returns the intersecti