Skip to content

Commit

Permalink
Keep latest duplicate instead of the oldest duplicate
Browse files Browse the repository at this point in the history
Keep latest duplicate instead of the oldest duplicate
  • Loading branch information
Ladas committed Nov 14, 2017
1 parent 0ba6661 commit e54e39b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Container < ActiveRecord::Base
end

def duplicate_data_query_returning_min_id(model, unique_index_columns)
model.group(unique_index_columns).select("min(id)")
model.group(unique_index_columns).select("max(id)")
end

def cleanup_duplicate_data_delete_all(model, unique_index_columns)
Expand Down

0 comments on commit e54e39b

Please sign in to comment.