From fb14aa0c1b6ced78331899d916607e1da015e164 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Mon, 29 Dec 2014 11:55:50 -0700 Subject: Ensure `first!` and friends work on loaded associations Fixes #18237 --- activerecord/lib/active_record/associations/collection_proxy.rb | 1 + 1 file changed, 1 insertion(+) (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 e1c01cfe06..dc42b19a83 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -29,6 +29,7 @@ module ActiveRecord # instantiation of the actual post records. class CollectionProxy < Relation delegate(*(ActiveRecord::Calculations.public_instance_methods - [:count]), to: :scope) + delegate :find_nth, to: :scope def initialize(klass, association) #:nodoc: @association = association -- cgit v1.2.3