aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-09-08 01:47:01 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-09-08 01:52:09 +0900
commita4b73f822ec96422e032b7d72c853e3c825859a6 (patch)
treeb2840b36178e5ab5fa40d8cee19fdf4c508c3d70 /activerecord/lib/active_record/connection_adapters/postgresql
parent0b31bed46e91b1482be72327d6770a33e935537c (diff)
downloadrails-a4b73f822ec96422e032b7d72c853e3c825859a6.tar.gz
rails-a4b73f822ec96422e032b7d72c853e3c825859a6.tar.bz2
rails-a4b73f822ec96422e032b7d72c853e3c825859a6.zip
Fix `quote_default_expression` for UUID with array default
Fixes #30539.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
index fc458d0c73..a0a22ba0f1 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
@@ -64,7 +64,7 @@ module ActiveRecord
def quote_default_expression(value, column) # :nodoc:
if value.is_a?(Proc)
value.call
- elsif column.type == :uuid && /\(\)/.match?(value)
+ elsif column.type == :uuid && value.is_a?(String) && /\(\)/.match?(value)
value # Does not quote function default values for UUID columns
elsif column.respond_to?(:array?)
value = type_cast_from_column(column, value)