diff options
author | Jefferson Lai <jeffersonlai@Jeffersons-MacBook-Pro.local> | 2014-04-01 20:18:16 -0700 |
---|---|---|
committer | Jefferson Lai <jeffersonlai@Jeffersons-MacBook-Pro.local> | 2014-04-02 13:43:26 -0700 |
commit | 1b187caaa1e1aa1bd0f440052b4df09a5ddaa4bf (patch) | |
tree | 19924a4d2f929162f23f2c8c426fd14689ea2aa0 /activerecord/lib | |
parent | f159b0a5a8e0c43942e8d60eb27a51f2679afa3e (diff) | |
download | rails-1b187caaa1e1aa1bd0f440052b4df09a5ddaa4bf.tar.gz rails-1b187caaa1e1aa1bd0f440052b4df09a5ddaa4bf.tar.bz2 rails-1b187caaa1e1aa1bd0f440052b4df09a5ddaa4bf.zip |
CollectionProxy uses the arel of its association's scope.
CollectionProxy should be able to reuse the behavior (methods) of its parent class,
but with its own state. This change allows CollectionProxy to use the arel object
corresponding to its association's scope.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_proxy.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index eba688866c..5b71ed163e 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -860,6 +860,10 @@ module ActiveRecord !!@association.include?(record) end + def arel + scope.arel + end + def proxy_association @association end |