Skip to content

Commit fcba7b3

Browse files
committed
Postgres syntax of arrays is '#{1,2,3}' (in quotes). But they aren't add automaticly.
1 parent 8d817c6 commit fcba7b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/activerecord-postgres-array/activerecord.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def arel_attributes_values(include_primary_key = true, include_readonly_attribut
1515
if include_readonly_attributes || !self.class.readonly_attributes.include?(name)
1616
value = read_attribute(name)
1717
if column.type.to_s =~ /_array$/ && value && value.is_a?(Array)
18-
value = value.to_postgres_array(new_record?)
18+
value = "'#{value.to_postgres_array(new_record?)}'"
1919
elsif defined?(::Hstore) && column.type == :hstore && value && value.is_a?(Hash)
2020
value = value.to_hstore
2121
elsif klass.serialized_attributes.include?(name)

0 commit comments

Comments
 (0)