aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorAnshul Sharma <justanshulsharma@gmail.com>2014-10-20 00:15:40 +0530
committerAnshul Sharma <justanshulsharma@gmail.com>2014-10-20 00:15:40 +0530
commit38148903fb23c0983497cf5b300bddfe9de1c251 (patch)
tree4e405ce6f45effca1d6ac9341433525b00aa9baf /activerecord/lib/active_record
parent091da45fd714848c76c710d04e17d33a24ccf3fd (diff)
downloadrails-38148903fb23c0983497cf5b300bddfe9de1c251.tar.gz
rails-38148903fb23c0983497cf5b300bddfe9de1c251.tar.bz2
rails-38148903fb23c0983497cf5b300bddfe9de1c251.zip
[ci skip] merge docs
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/merger.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/merger.rb b/activerecord/lib/active_record/relation/merger.rb
index ac41d0aa80..fa968ac5af 100644
--- a/activerecord/lib/active_record/relation/merger.rb
+++ b/activerecord/lib/active_record/relation/merger.rb
@@ -13,6 +13,13 @@ module ActiveRecord
@hash = hash
end
+ # It allows to do a join, and filter by a scope on the joined model:
+ # class Account < ActiveRecord::Base
+ # # Returns all the accounts that have unread messages.
+ # def self.with_unread_messages
+ # joins(:messages).merge( Message.unread )
+ # end
+ # end
def merge
Merger.new(relation, other).merge
end