From 55c05276c71548f158cb9ae28fe2a154de9f8349 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Sat, 26 May 2012 22:43:24 -0500 Subject: [PATCH] add CollectionProxy#uniq documentation --- .../associations/collection_proxy.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index 7408428493..294aa63f75 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -636,6 +636,27 @@ class CollectionProxy < Relation # # Pet.find(4, 5, 6) # => ActiveRecord::RecordNotFound: Couldn't find all Pets with IDs (4, 5, 6) + ## + # :method: uniq + # + # :call-seq: + # uniq() + # + # Specifies whether the records should be unique or not. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets.select(:name) + # # => [ + # # #, + # # # + # # ] + # + # person.pets.select(:name).uniq + # # => [#] + ## # :method: count # -- GitLab