Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


when position is null all new items get inserted in position 1 #41

cdcdcd123 opened this Issue · 6 comments

5 participants


I'm using 'remove_from_list' and a deleted_at attribute to remove items from list. The problem is that when creating a new record, if there are other records in the list with position of null, all new records get set to position 1. A workaround I've used is to set a default scope of :conditions => (:position ^ nil), but it seems to me at least, that the private method 'bottom_item' should have a default condition of position not nil.


You can use other boolean column.
I think that position column should not have NULL value.


True. If you look at it from a semantic perspective, a list cannot have items w/o position.


I see your point. But why is there a remove_from_list method? What would be a use-case for this method?


I've added some code to pull #72 which fixes this issue. Now items which have been removed from the list and respond false to :in_list? will not be fetched from :bottom_item. This is important because otherwise :add_to_list_bottom breaks.


@swanandp Any chance of getting the fixes in #72 merged in?


@nathany Done!

@swanandp swanandp closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.