Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge commit 'rails/master'

  • Loading branch information...
commit ef8d26653d308354050ed80f61444bec5458ce05 2 parents 59f5d4f + 55622e0
@jeremy jeremy authored
View
2  activerecord/lib/active_record/calculations.rb
@@ -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])
View
2  activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.