diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-07-20 12:56:57 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-20 12:56:57 -0300 |
commit | b1d48d542452e5d87b42a8af513b7102d92b0684 (patch) | |
tree | 28b7b4120a77673a172bc4774966f31c7128693c /activerecord/lib | |
parent | 5757b9dbe732be03d41d4c23a6545bc396545421 (diff) | |
parent | 1a10d38d465b4f8843ec916538ad0fc70a890f4d (diff) | |
download | rails-b1d48d542452e5d87b42a8af513b7102d92b0684.tar.gz rails-b1d48d542452e5d87b42a8af513b7102d92b0684.tar.bz2 rails-b1d48d542452e5d87b42a8af513b7102d92b0684.zip |
Merge pull request #25786 from kamipo/add_exists_and_update_all_to_collection_proxy
Add `exists?` and `update_all` to `CollectionProxy` for respects an association scope
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_proxy.rb | 6 |
1 files changed, 1 insertions, 5 deletions
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 |