Skip to content

Commit c9b7928

Browse files
author
Tim Connor
committed
Merge branch 'patch-1' of git://github.com/izzm/activerecord-postgres-array into izzm-patch-1
Conflicts: lib/activerecord-postgres-array/activerecord.rb
2 parents 07c5291 + fcba7b3 commit c9b7928

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/activerecord-postgres-array/activerecord.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ 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?)}'"
19+
elsif defined?(::Hstore) && column.type == :hstore && value && value.is_a?(Hash)
20+
value = value.to_hstore
1921
elsif klass.serialized_attributes.include?(name)
2022
value = @attributes[name].serialized_value
2123
end

0 commit comments

Comments
 (0)