From da685e749aee37d4ce068d840baf258e46201b66 Mon Sep 17 00:00:00 2001 From: "samchen2009@gmail.com" Date: Fri, 28 Dec 2012 23:31:16 +0800 Subject: [PATCH] Fix (refs #13) - user's wip_limit doesn't get updated --- plugins/ekanban/app/models/kanban.rb | 6 ++++++ plugins/ekanban/db/migrate/011_add_wip_col_to_user.rb | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 plugins/ekanban/db/migrate/011_add_wip_col_to_user.rb diff --git a/plugins/ekanban/app/models/kanban.rb b/plugins/ekanban/app/models/kanban.rb index 5e294a170..c6de06035 100644 --- a/plugins/ekanban/app/models/kanban.rb +++ b/plugins/ekanban/app/models/kanban.rb @@ -145,6 +145,12 @@ def wip KanbanCard.open().by_user(self).in_progress().size end + def wip_limit + id = CustomField.find_by_name("WIP limit").id + v = self.custom_value_for(id) + v.nil? ? 3 : v.value.to_i + end + end class Principal < ActiveRecord::Base diff --git a/plugins/ekanban/db/migrate/011_add_wip_col_to_user.rb b/plugins/ekanban/db/migrate/011_add_wip_col_to_user.rb deleted file mode 100644 index dba490a5c..000000000 --- a/plugins/ekanban/db/migrate/011_add_wip_col_to_user.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddWipColToUser < ActiveRecord::Migration - def change - #table "user" - add_column :users, :wip_limit, :integer, :default=>2 - end -end