diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-16 13:52:57 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-16 14:28:19 -0800 |
commit | 5f608fc7c4fa3ac793f1eb1b1f418033dfb13049 (patch) | |
tree | c07f01d96a12c4064887f9a05607d449e11a6c38 /activerecord/lib/active_record/associations/association_collection.rb | |
parent | c801f233df9d20c59d9756a5279365603dc5cbbd (diff) | |
download | rails-5f608fc7c4fa3ac793f1eb1b1f418033dfb13049.tar.gz rails-5f608fc7c4fa3ac793f1eb1b1f418033dfb13049.tar.bz2 rails-5f608fc7c4fa3ac793f1eb1b1f418033dfb13049.zip |
removing space errors
Diffstat (limited to 'activerecord/lib/active_record/associations/association_collection.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index 600f59026e..34247deb02 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -182,7 +182,7 @@ module ActiveRecord unless options.blank? raise ArgumentError, "If finder_sql/counter_sql is used then options cannot be passed" end - + @reflection.klass.count_by_sql(custom_counter_sql) else @@ -435,10 +435,10 @@ module ActiveRecord # replace the SELECT clause with COUNT(*), preserving any hints within /* ... */ counter_sql = @reflection.options[:finder_sql].sub(/SELECT\b(\/\*.*?\*\/ )?(.*)\bFROM\b/im) { "SELECT #{$1}COUNT(*) FROM" } end - + interpolate_sql(counter_sql) end - + def custom_finder_sql interpolate_sql(@reflection.options[:finder_sql]) end |