diff options
author | Jon Leighton <j@jonathanleighton.com> | 2010-10-17 23:29:56 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2010-10-17 23:29:56 +0100 |
commit | 78b8c51cb3b0c629152f3bbaf6d8bcf988cc936e (patch) | |
tree | eae58b0877ee952c7a1809c02ad19ea7762e6440 /activerecord/lib/active_record/associations/has_one_through_association.rb | |
parent | edc176d33be9499f4c096779c5b4711b5daf0c06 (diff) | |
download | rails-78b8c51cb3b0c629152f3bbaf6d8bcf988cc936e.tar.gz rails-78b8c51cb3b0c629152f3bbaf6d8bcf988cc936e.tar.bz2 rails-78b8c51cb3b0c629152f3bbaf6d8bcf988cc936e.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/associations/has_one_through_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_through_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_through_association.rb b/activerecord/lib/active_record/associations/has_one_through_association.rb index 8153eb7c57..de962e01b6 100644 --- a/activerecord/lib/active_record/associations/has_one_through_association.rb +++ b/activerecord/lib/active_record/associations/has_one_through_association.rb @@ -35,7 +35,7 @@ module ActiveRecord private def find_target - with_scope(construct_scope) { @reflection.klass.find(:first) } + with_scope(@scope) { @reflection.klass.find(:first) } end end end |