itmammoth / rails_sortable

Easy drag & drop sorting with persisting the arranged order for rails
MIT License
143 stars 37 forks source link

Sort ID independely through the same model #32

Closed lucaszmoraes closed 6 years ago

lucaszmoraes commented 6 years ago

Is there any way to use RailsSortable independently through the same model?

Here is my user case: we have an online course app. The Models are:

So a given Course can have many Lessons. As we are using RailsSortable to index and order the lessons freely at the Lessons Model level - the sort id that we are getting is sequentional through the Lessons:

Course 1: --- Lesson 1 has sort_id=1 --- Lesson 2 has sort_id=2

Course 2: --- Lesson 1 has sort_id=4 --- Lesson 2 has sort_id=5

The better use for our case would be have sort_id independent and not sequentional throught the model. Would be that possible?