Permalink
Browse files

remove spaces before parens to avoid deprecation warnings in some rub…

…y versions
  • Loading branch information...
1 parent 3be3ad5 commit 199ad67bd3b2a5fbec1db3c0a252d8252ef595bc @mjankowski mjankowski committed Oct 12, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/pacecar/associations.rb
  2. +2 −2 lib/pacecar/ranking.rb
@@ -31,7 +31,7 @@ def has_recent_records(*names)
protected
def conditions_for_name(name)
- "((select count(*) from #{connection.quote_table_name(name)} where #{connection.quote_table_name(name)}.#{connection.quote_column_name (reflections[name].respond_to?(:foreign_key) ? reflections[name].foreign_key : reflections[name].primary_key_name)} = #{quoted_table_name}.#{connection.quote_column_name primary_key} and #{connection.quote_table_name(name)}.#{connection.quote_column_name("created_at")} > :since_time) > 0)"
+ "((select count(*) from #{connection.quote_table_name(name)} where #{connection.quote_table_name(name)}.#{connection.quote_column_name(reflections[name].respond_to?(:foreign_key) ? reflections[name].foreign_key : reflections[name].primary_key_name)} = #{quoted_table_name}.#{connection.quote_column_name primary_key} and #{connection.quote_table_name(name)}.#{connection.quote_column_name("created_at")} > :since_time) > 0)"
end
end
@@ -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 199ad67

Please sign in to comment.