From 1a10d38d465b4f8843ec916538ad0fc70a890f4d Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Tue, 12 Jul 2016 06:01:23 +0900 Subject: Add `exists?` and `update_all` to `CollectionProxy` for respects an association scope Fixes #25732. --- activerecord/lib/active_record/associations/collection_proxy.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (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 17ccf5a86c..db3037d8f9 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -29,7 +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 + delegate :find_nth, :exists?, :update_all, :arel, to: :scope def initialize(klass, association) #:nodoc: @association = association @@ -897,10 +897,6 @@ module ActiveRecord !!@association.include?(record) end - def arel #:nodoc: - scope.arel - end - def proxy_association @association end -- cgit v1.2.3