aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-04-20 16:50:41 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-04-20 16:50:41 -0700
commitef8d26653d308354050ed80f61444bec5458ce05 (patch)
tree997c4615ffefbd361a808ab097c7366052537894 /activerecord/lib/active_record
parent59f5d4fc79b72a2bf0f7ffada4a1a73eb303d943 (diff)
parent55622e0bde999193ae4a848d28cf2ce7e9247d83 (diff)
downloadrails-ef8d26653d308354050ed80f61444bec5458ce05.tar.gz
rails-ef8d26653d308354050ed80f61444bec5458ce05.tar.bz2
rails-ef8d26653d308354050ed80f61444bec5458ce05.zip
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/calculations.rb2
-rw-r--r--activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb
index 64527ec3f0..b5bf82ee11 100644
--- a/activerecord/lib/active_record/calculations.rb
+++ b/activerecord/lib/active_record/calculations.rb
@@ -178,7 +178,7 @@ module ActiveRecord
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])
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
index 92d11e56e1..59a51c0279 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -257,7 +257,7 @@ module ActiveRecord
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