Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(FIX) Error for array of integers for postgres #10340

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -69,15 +69,16 @@ def json_to_string(object)

def array_to_string(value, column, adapter, should_be_quoted = false)
casted_values = value.map do |val|
if String === val
if val == "NULL"
"\"#{val}\""
else
quote_and_escape(adapter.type_cast(val, column, true))
casted_value = adapter.type_cast(val, column, true)
if String === casted_value
quote_and_escape(casted_value)
else
casted_value
end
end
else
adapter.type_cast(val, column, true)
end
end
"{#{casted_values.join(',')}}"
end
Expand Down