diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-12-29 11:55:50 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-12-29 11:56:37 -0700 |
commit | fb14aa0c1b6ced78331899d916607e1da015e164 (patch) | |
tree | 5f25d26fc099bdcec4d4f20f5668f9013b6a1897 /activerecord/lib | |
parent | 2223f491576f8f2c1c38fa5acbbe62dc9d715c75 (diff) | |
download | rails-fb14aa0c1b6ced78331899d916607e1da015e164.tar.gz rails-fb14aa0c1b6ced78331899d916607e1da015e164.tar.bz2 rails-fb14aa0c1b6ced78331899d916607e1da015e164.zip |
Ensure `first!` and friends work on loaded associations
Fixes #18237
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_proxy.rb | 1 |
1 files changed, 1 insertions, 0 deletions
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 |