method
array_to_string
v4.1.8 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::PostgreSQLColumn::Cast
array_to_string(value, column, adapter)public
No documentation available.
# File activerecord/lib/active_record/connection_adapters/postgresql/cast.rb, line 70
def array_to_string(value, column, adapter)
casted_values = value.map do |val|
if String === val
if val == "NULL"
"\"#{val}\""
else
quote_and_escape(adapter.type_cast(val, column, true))
end
else
adapter.type_cast(val, column, true)
end
end
"{#{casted_values.join(',')}}"
end