This is now pushed. Now, i take a look at the ticket 71.
--
Benjamin LAN-SUN-LUK



Le 26/11/08 02:03, « Darryl Pierce » <mcpierce@gmail.com> a écrit :

On Tue, Nov 25, 2008 at 7:47 PM, LAN-SUN-LUK Benjamin
<Benjamin.LAN-SUN-LUK@supinfo.com> wrote:
>
> Signed-off-by: Benjamin LAN-SUN-LUK <benjamin.lan-sun-luk@supinfo.com>
> ---
>  app/controllers/items_controller.rb |    1 +
>  app/models/backlog_item.rb          |    2 +-
>  2 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/app/controllers/items_controller.rb
> b/app/controllers/items_controller.rb
> index fa68ad0..902daf8 100644
> --- a/app/controllers/items_controller.rb
> +++ b/app/controllers/items_controller.rb
> @@ -100,6 +100,7 @@ class ItemsController < ApplicationController
>
>   # GET /products/1/sprints/1/items/1/drop
>   def drop
> +    raise "You cannot drop that backlog item because some tasks are against
> it." unless @backlog_item.tasks.empty?
>     respond_to do |format|
>       if @backlog_item.can_drop?(@user)
>         @backlog_item.drop
> diff --git a/app/models/backlog_item.rb b/app/models/backlog_item.rb
> index 4fd4501..d962fda 100644
> --- a/app/models/backlog_item.rb
> +++ b/app/models/backlog_item.rb
> @@ -152,7 +152,7 @@ class BacklogItem < ActiveRecord::Base
>
>   # Returns whether the user can drop this backlog item.
>   def can_drop?(user)
> -    (state == STATE_ASSIGNED) && owner?(user) && sprint.active?
> +    (state == STATE_ASSIGNED) && owner?(user) && sprint.active? &&
> self.tasks.empty?
>   end
>
>   # Returns whether the user can complete this backlog item.

ACK.

There's another ticket that should be taken care of quickly, #71. If a
sprint has is in the active state and has tasks then we need to not
allow the product owner to move the task back to the planned state.

--
Darryl L. Pierce <mcpierce@gmail.com>
Visit the Infobahn Offramp: <http://mcpierce.multiply.com>
"Bury me next to my wife. Nothing too fancy..." - Ulysses S. Grant
_______________________________________________
projxp-devel mailing list
projxp-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/projxp-devel