ranked-model icon indicating copy to clipboard operation
ranked-model copied to clipboard

read row_order_position => nil

Open gagalago opened this issue 11 years ago • 1 comments

when i use an_object.row_order_position, i have nil but an_object.row_order return 4194304.

row_order_position isn't an accesor to have the position of the object ? how can I get it with ranked-model ?

actually, I use this : AllObject.all.find_index(an_object)

gagalago avatar Mar 10 '14 10:03 gagalago

an alternative is to do

AllObject.where("row_order < ?", an_object.row_order).count

I believe it's faster but I depends on if you have AllObject.all cached or not (if you use it somewhere else in the same request)

elfassy avatar Jun 16 '14 14:06 elfassy

Good hints there :) Closing due to age.

brendon avatar Jun 04 '24 04:06 brendon