diff options
Diffstat (limited to 'activerecord/lib/active_record/associations/collection_proxy.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_proxy.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index adfc71d435..8415942a1a 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -123,6 +123,30 @@ module ActiveRecord method_missing(:new, *args, &block) end end + + def proxy_owner + ActiveSupport::Deprecation.warn( + "Calling record.#{@association.reflection.name}.proxy_owner is deprecated. Please use " \ + "record.association(:#{@association.reflection.name}).owner instead." + ) + @association.owner + end + + def proxy_target + ActiveSupport::Deprecation.warn( + "Calling record.#{@association.reflection.name}.proxy_target is deprecated. Please use " \ + "record.association(:#{@association.reflection.name}).target instead." + ) + @association.target + end + + def proxy_reflection + ActiveSupport::Deprecation.warn( + "Calling record.#{@association.reflection.name}.proxy_reflection is deprecated. Please use " \ + "record.association(:#{@association.reflection.name}).reflection instead." + ) + @association.reflection + end end end end |