Skip to content

Commit

Permalink
Merge commit 'rails/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Apr 20, 2008
2 parents 59f5d4f + 55622e0 commit ef8d266
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/calculations.rb
Expand Up @@ -178,7 +178,7 @@ def construct_calculation_sql(operation, column_name, options) #:nodoc:
sql = "SELECT COUNT(*) AS #{aggregate_alias}" if use_workaround

sql << ", #{options[:group_field]} AS #{options[:group_alias]}" if options[:group]
sql << " FROM (SELECT DISTINCT #{column_name}" if use_workaround
sql << " FROM (SELECT #{distinct}#{column_name}" if use_workaround
sql << " FROM #{connection.quote_table_name(table_name)} "
if merged_includes.any?
join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(self, merged_includes, options[:joins])
Expand Down
Expand Up @@ -257,7 +257,7 @@ def select(sql, name = nil) #:nodoc:
record = {}
row.each_key do |key|
if key.is_a?(String)
record[key.sub(/^\w+\./, '')] = row[key]
record[key.sub(/^"?\w+"?\./, '')] = row[key]
end
end
record
Expand Down

0 comments on commit ef8d266

Please sign in to comment.