collectiveidea/awesome_nested_set

Duplicates for columns

nguyenthaison opened this issue · 0 comments

I have use gem paranoia for soft_delete table Folder and have problem is:
when i create folder A and B -> delete folder A -> restore A. Now, A and B same value lft and rgt.
I check function
def no_duplicates_for_columns? [quoted_left_column_full_name, quoted_right_column_full_name].all? do |column| # No duplicates select("#{scope_string}#{column}, COUNT(#{column}) as _count"). group("#{scope_string}#{column}", quoted_primary_key_column_full_name). having("COUNT(#{column}) > 1"). order(quoted_primary_key_column_full_name). first.nil? end end

result is wrong and no rebuild tree. Please fix it.