aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_many_through_association.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-06-30 20:32:28 -0300
committerEmilio Tagua <miloops@gmail.com>2009-06-30 20:32:28 -0300
commitcbf8ecc1cba733c92191cacdf9bdfa0f5555b68a (patch)
treef1a6943b568aa2cf032e6deaa9b3f220a1dc64c0 /activerecord/lib/active_record/associations/has_many_through_association.rb
parente5b8c4483c8de805d5847563edcf4e5d7e035a87 (diff)
parent45e6f19925f23c3db257c15371d8f512cca843cd (diff)
downloadrails-cbf8ecc1cba733c92191cacdf9bdfa0f5555b68a.tar.gz
rails-cbf8ecc1cba733c92191cacdf9bdfa0f5555b68a.tar.bz2
rails-cbf8ecc1cba733c92191cacdf9bdfa0f5555b68a.zip
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/lib/active_record/associations/has_many_through_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_many_through_association.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb
index f4cab0789c..2a1d645859 100644
--- a/activerecord/lib/active_record/associations/has_many_through_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_through_association.rb
@@ -90,15 +90,7 @@ module ActiveRecord
@finder_sql = construct_conditions
end
- if @reflection.options[:counter_sql]
- @counter_sql = interpolate_sql(@reflection.options[:counter_sql])
- elsif @reflection.options[:finder_sql]
- # replace the SELECT clause with COUNT(*), preserving any hints within /* ... */
- @reflection.options[:counter_sql] = @reflection.options[:finder_sql].sub(/SELECT (\/\*.*?\*\/ )?(.*)\bFROM\b/im) { "SELECT #{$1}COUNT(*) FROM" }
- @counter_sql = interpolate_sql(@reflection.options[:counter_sql])
- else
- @counter_sql = @finder_sql
- end
+ construct_counter_sql
end
def has_cached_counter?