#739 ✓resolved
Brian Terlson

[PATCH] dm-is-list #move with :to option is broken

Reported by Brian Terlson | January 2nd, 2009 @ 01:26 PM | in 0.10.0

When you specify a position to move to with :to, the list gets broken.

Example:


%w(rubygems dm-core dm-is-list).each{|r| require r }

DataMapper.setup(:default, 'sqlite3::memory:')

class Todo
  include DataMapper::Resource

  property :id, Serial

  is :list
end

Todo.auto_migrate!

@todo_1 = Todo.create
@todo_2 = Todo.create
@todo_3 = Todo.create

@todo_1.move(:to => 2)
Todo.all.inspect
# => "[#<Todo id=1 position=0>, #<Todo id=2 position=2>, #<Todo id=3 position=3>]"

Comments and changes to this ticket

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Attachments

Referenced by

Pages