Skip to content
Browse files

fix deprecation warnings

  • Loading branch information...
1 parent 1e48753 commit 19baea98545186907e98755f138dddf2dad6a4a6 @wireframe wireframe committed Sep 20, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/pacecar/ranking.rb
View
4 lib/pacecar/ranking.rb
@@ -27,7 +27,7 @@ def has_calculated_records(*names)
def define_ranking_scope(association, direction_name, direction)
scope "#{direction_name}_#{association}", {
- :select => "#{quoted_table_name}.*, count(#{reflections[association].quoted_table_name}.#{connection.quote_column_name (reflections[association].respond_to?(:foreign_key) ? reflections[association].foreign_key : reflections[association].primary_key_name)}) as #{association}_count",
+ :select => "#{quoted_table_name}.*, count(#{reflections[association].quoted_table_name}.#{connection.quote_column_name(reflections[association].respond_to?(:foreign_key) ? reflections[association].foreign_key : reflections[association].primary_key_name)}) as #{association}_count",
:order => "#{association}_count #{direction}"
}.merge(association_group_and_join(association))
end
@@ -43,7 +43,7 @@ def define_calculated_scope(association_name, column, function_name, function_me
def association_group_and_join(association_name)
{
- :joins => "inner join #{connection.quote_table_name(association_name)} on #{connection.quote_table_name(association_name)}.#{connection.quote_column_name (reflections[association_name].respond_to?(:foreign_key) ? reflections[association_name].foreign_key : reflections[association_name].primary_key_name)} = #{quoted_table_name}.#{connection.quote_column_name primary_key}",
+ :joins => "inner join #{connection.quote_table_name(association_name)} on #{connection.quote_table_name(association_name)}.#{connection.quote_column_name(reflections[association_name].respond_to?(:foreign_key) ? reflections[association_name].foreign_key : reflections[association_name].primary_key_name)} = #{quoted_table_name}.#{connection.quote_column_name primary_key}",
:group => safe_column_names.collect { |column_name| "#{quoted_table_name}.#{connection.quote_column_name(column_name)}" }.join(', ')
}
end

0 comments on commit 19baea9

Please sign in to comment.
Something went wrong with that request. Please try again.