Skip to content

Commit

Permalink
Fix issue with task's dependencies. Fixes #580
Browse files Browse the repository at this point in the history
  • Loading branch information
k41n committed Apr 29, 2016
1 parent 06ae556 commit b7eb22d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/controllers/widgets_controller.rb
Expand Up @@ -156,11 +156,10 @@ def tasks_extracted_from_show
filter = filter_from_filter_by

unless @widget.mine?
@items = TaskRecord.accessed_by(current_user).where("tasks.completed_at IS NULL #{filter} AND (tasks.hide_until IS NULL OR tasks.hide_until < ?) AND (tasks.milestone_id NOT IN (?) OR tasks.milestone_id IS NULL)", tz.now.utc.to_s(:db), completed_milestone_ids).includes(:milestone, :dependencies, :dependants, :todos, :tags)
@items = TaskRecord.accessed_by(current_user).where("tasks.completed_at IS NULL #{filter} AND (tasks.hide_until IS NULL OR tasks.hide_until < ?) AND (tasks.milestone_id NOT IN (?) OR tasks.milestone_id IS NULL)", tz.now.utc.to_s(:db), completed_milestone_ids).eager_load(:milestone, :dependencies, :dependants, :todos, :tags)
else
@items = current_user.tasks.where("tasks.project_id IN (?) #{filter} AND tasks.completed_at IS NULL AND (tasks.hide_until IS NULL OR tasks.hide_until < ?) AND (tasks.milestone_id NOT IN (?) OR tasks.milestone_id IS NULL)", current_project_ids, tz.now.utc.to_s(:db), completed_milestone_ids).includes(:milestone, { :project => :customer }, :dependencies, :dependants, :todos, :tags)
@items = current_user.tasks.where("tasks.project_id IN (?) #{filter} AND tasks.completed_at IS NULL AND (tasks.hide_until IS NULL OR tasks.hide_until < ?) AND (tasks.milestone_id NOT IN (?) OR tasks.milestone_id IS NULL)", current_project_ids, tz.now.utc.to_s(:db), completed_milestone_ids).eager_load(:milestone, { :project => :customer }, :dependencies, :dependants, :todos, :tags)
end

@items = case @widget.order_by
when 'priority' then
current_user.company.sort(@items)[0, @widget.number]
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Expand Up @@ -77,6 +77,7 @@
get :users_to_notify_popup
get :get_watcher
get :get_default_customers
get :dependency
end
member do
post :set_group
Expand Down

0 comments on commit b7eb22d

Please sign in to comment.