Skip to content

Commit

Permalink
Improve performance and functionality of the postgresql adapter. Closes
Browse files Browse the repository at this point in the history
#8049 [roderickvd]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
NZKoz committed Aug 16, 2007
1 parent f008566 commit 29b0707
Show file tree
Hide file tree
Showing 8 changed files with 673 additions and 225 deletions.
4 changes: 4 additions & 0 deletions activerecord/CHANGELOG
@@ -1,5 +1,9 @@
*SVN*

* Improve performance and functionality of the postgresql adapter. Closes #8049 [roderickvd]

For more information see: http://dev.rubyonrails.org/ticket/8049

* Don't clobber includes passed to has_many.count [danger]

* Make sure has_many uses :include when counting [danger]
Expand Down
Expand Up @@ -11,12 +11,12 @@ def quote(value, column = nil)
when String, ActiveSupport::Multibyte::Chars
value = value.to_s
if column && column.type == :binary && column.class.respond_to?(:string_to_binary)
"'#{quote_string(column.class.string_to_binary(value))}'" # ' (for ruby-mode)
"#{quoted_string_prefix}'#{quote_string(column.class.string_to_binary(value))}'" # ' (for ruby-mode)
elsif column && [:integer, :float].include?(column.type)
value = column.type == :integer ? value.to_i : value.to_f
value.to_s
else
"'#{quote_string(value)}'" # ' (for ruby-mode)
"#{quoted_string_prefix}'#{quote_string(value)}'" # ' (for ruby-mode)
end
when NilClass then "NULL"
when TrueClass then (column && column.type == :integer ? '1' : quoted_true)
Expand All @@ -28,7 +28,7 @@ def quote(value, column = nil)
if value.acts_like?(:date) || value.acts_like?(:time)
"'#{quoted_date(value)}'"
else
"'#{quote_string(value.to_yaml)}'"
"#{quoted_string_prefix}'#{quote_string(value.to_yaml)}'"
end
end
end
Expand Down Expand Up @@ -56,6 +56,10 @@ def quoted_false
def quoted_date(value)
value.to_s(:db)
end

def quoted_string_prefix
''
end
end
end
end

0 comments on commit 29b0707

Please sign in to comment.