I am working on user's model in which users will be sorted on the basis of sort_order for them.
What I am trying to achieve is that
if we set same sort_order for a new user or update existing user, all users with same sort_order are incremented.
we have 3 user types with their sort_order as follows
Gold with sort_order as 1
Diamond with sort_order as 2
Platinum with sort_order as 3
Updating Gold to 2 should result in Diamond increasing to 3 and Platinum increasing to 4.
Is there a way to do this in Rails?