From 33a7eedc01a54c685723ad5a7795e332a5132ca1 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Tue, 6 Sep 2016 23:24:11 +0530 Subject: Revert " [ci skip] Remove duplicate example." --- activerecord/lib/active_record/associations/collection_proxy.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index 1302f3c7e4..dda240585e 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -107,6 +107,11 @@ module ActiveRecord # # # # # ] # + # person.pets.select(:name) { |pet| pet.name =~ /oo/ } + # # => [ + # # #, + # # # + # # ] # Finds an object in the collection responding to the +id+. Uses the same # rules as ActiveRecord::Base.find. Returns ActiveRecord::RecordNotFound -- cgit v1.2.3