brendon / acts_as_list

An ActiveRecord plugin for managing lists.
http://brendon.github.io/acts_as_list/
MIT License
2.05k stars 356 forks source link

Add scope when calling maximum in insert_at_position #270

Closed yatish27 closed 7 years ago

yatish27 commented 7 years ago

It adds scope to insert_at_position. When we call acts_as_list_class.maximum(position_column), it scans the entire table. We need to know the maximum with respect to the scope defined in the acts_as_list class. This is improves performance as it will not scan the entire table.

yatish27 commented 7 years ago

This is already fixed so closing it

brendon commented 7 years ago

That's correct. acts_as_list_class removes any where clauses and then applies ours.