There was an error while loading. Please reload this page.
2 parents 07c5291 + fcba7b3 commit c9b7928Copy full SHA for c9b7928
1 file changed
lib/activerecord-postgres-array/activerecord.rb
@@ -15,7 +15,9 @@ def arel_attributes_values(include_primary_key = true, include_readonly_attribut
15
if include_readonly_attributes || !self.class.readonly_attributes.include?(name)
16
value = read_attribute(name)
17
if column.type.to_s =~ /_array$/ && value && value.is_a?(Array)
18
- value = value.to_postgres_array(new_record?)
+ value = "'#{value.to_postgres_array(new_record?)}'"
19
+ elsif defined?(::Hstore) && column.type == :hstore && value && value.is_a?(Hash)
20
+ value = value.to_hstore
21
elsif klass.serialized_attributes.include?(name)
22
value = @attributes[name].serialized_value
23
end
0 commit comments