
dm-is-list #reorder_list doesn't function properly
Reported by Brian Terlson | January 2nd, 2009 @ 01:38 PM | in 0.10.0
Reordering a list doesn't set the positions correctly.
%w(rubygems dm-core dm-is-list).each{|r| require r }
DataMapper.setup(:default, 'sqlite3::memory:')
class Todo
include DataMapper::Resource
property :id, Serial
property :title, String
is :list
end
Todo.auto_migrate!
@todo_1 = Todo.create(:title => "Flip mattress")
@todo_2 = Todo.create(:title => "Empty trash")
@todo_3 = Todo.create(:title => "Do something fun")
@todo_4 = Todo.create(:title => "Clean the house")
@todo_5 = Todo.create(:title => "Brush the dogs")
@todo_6 = Todo.create(:title => "Arrange bookshelf")
@todo_1.reorder_list([:title.asc])
Todo.all.inspect
# => "[#<Todo id=1 title=\"Flip mattress\" position=6>, #<Todo id=2 title=\"Empty trash\" position=4>, #<Todo id=3 title=\"Do something fun\" position=3>, #<Todo id=4 title=\"Clean the house\" position=1>, #<Todo id=5 title=\"Brush the dogs\" position=1>, #<Todo id=6 title=\"Arrange bookshelf\" position=0>]"
There are duplicate positions (position 1), a position below the minimum position (position 0).
Comments and changes to this ticket
-
Dan Kubb (dkubb) January 7th, 2009 @ 04:24 PM
- Assigned user set to Sindre Aarsaether
-
Martin Gamsjaeger (snusnu) July 9th, 2009 @ 07:32 PM
A more recent discussion about problems with dm-is-list is going on over at #891 . I'm trying to collect all reported issues with dm-is-list over there because it will make it easier to check if all (reported) cases are solved before 0.10
-
Martin Gamsjaeger (snusnu) July 9th, 2009 @ 07:48 PM
- Assigned user changed from Sindre Aarsaether to Martin Gamsjaeger (snusnu)
- State changed from unconfirmed to accepted
- Milestone set to 0.10.0
-
Martin Gamsjaeger (snusnu) July 14th, 2009 @ 09:31 AM
- State changed from accepted to resolved
Resolved as of
http://github.com/datamapper/dm-more/commit/e497c24c925223c935c5f2c...
Thx again kematzy!
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Tags
Referenced by
-
891 [patch] is list #735 #737 #738 and #740 are all related to bugs in dm-is-...