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.
It adds scope to
insert_at_position
. When we callacts_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.