lib/parentry/strategy/array/instance_methods.rb in parentry-1.7.0 vs lib/parentry/strategy/array/instance_methods.rb in parentry-1.8.0

- old
+ new

@@ -13,24 +13,24 @@ end def cascade_parentry old_path, new_path = saved_changes[parentry_column] parentry_scope.where( - ["#{parentry_column} @> ARRAY[:tree] AND id != :id", { tree: old_path, id: }] + ["#{parentry_column} @> ARRAY[:tree]::integer[] AND id != :id", { tree: old_path, id: }] ).update_all( [ "#{parentry_column} = array_cat(ARRAY[?], #{parentry_column}[?:array_length(#{parentry_column}, 1)])", new_path, old_path.size + 1 ] ) end def subtree_conditions - ["#{parentry_column} @> ARRAY[?]", parentry] + ["#{parentry_column} @> ARRAY[?]::integer[]", parentry] end def ancestor_conditions - ["#{parentry_column} <@ ARRAY[?]", parentry] + ["#{parentry_column} <@ ARRAY[?]::integer[]", parentry] end end end end end