diff options
author | Jon Leighton <j@jonathanleighton.com> | 2010-10-21 17:35:07 +0100 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-30 06:30:00 -0700 |
commit | b82fab25f999dd6245c23a22f948048eef2d5d9a (patch) | |
tree | ea3a443035b94c0eda5ce051bd6a2f6aea7f96a7 /activerecord/lib/active_record/autosave_association.rb | |
parent | 2a47e7ef105559c4c931efff8fd14c454a21cf7a (diff) | |
download | rails-b82fab25f999dd6245c23a22f948048eef2d5d9a.tar.gz rails-b82fab25f999dd6245c23a22f948048eef2d5d9a.tar.bz2 rails-b82fab25f999dd6245c23a22f948048eef2d5d9a.zip |
Refactoring: replace the mix of variables like @finder_sql, @counter_sql, etc with just a single scope hash (created on initialization of the proxy). This is now used consistently across all associations. Therefore, all you have to do to ensure finding/counting etc is done correctly is implement the scope correctly.
Diffstat (limited to 'activerecord/lib/active_record/autosave_association.rb')
-rw-r--r-- | activerecord/lib/active_record/autosave_association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb index 4a2c078e91..0b89a49896 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -322,8 +322,8 @@ module ActiveRecord end end - # reconstruct the SQL queries now that we know the owner's id - association.send(:construct_sql) if association.respond_to?(:construct_sql) + # reconstruct the scope now that we know the owner's id + association.send(:construct_scope) if association.respond_to?(:construct_scope) end end |