@@ -35,7 +35,7 class IssueCategory < ActiveRecord::Base | |||
|
35 | 35 | # If a category is specified, issues are reassigned to this category |
|
36 | 36 | def destroy(reassign_to = nil) |
|
37 | 37 | if reassign_to && reassign_to.is_a?(IssueCategory) && reassign_to.project == self.project |
|
38 |
Issue.update_all( |
|
|
38 | Issue.update_all({:category_id => reassign_to.id}, {:category_id => id}) | |
|
39 | 39 | end |
|
40 | 40 | destroy_without_reassign |
|
41 | 41 | end |
@@ -67,7 +67,7 class Message < ActiveRecord::Base | |||
|
67 | 67 | |
|
68 | 68 | def update_messages_board |
|
69 | 69 | if board_id_changed? |
|
70 |
Message.update_all( |
|
|
70 | Message.update_all({:board_id => board_id}, ["id = ? OR parent_id = ?", root.id, root.id]) | |
|
71 | 71 | Board.reset_counters!(board_id_was) |
|
72 | 72 | Board.reset_counters!(board_id) |
|
73 | 73 | end |
@@ -30,7 +30,7 class Principal < ActiveRecord::Base | |||
|
30 | 30 | has_many :issue_categories, :foreign_key => 'assigned_to_id', :dependent => :nullify |
|
31 | 31 | |
|
32 | 32 | # Groups and active users |
|
33 |
scope :active, lambda { where( |
|
|
33 | scope :active, lambda { where(:status => STATUS_ACTIVE) } | |
|
34 | 34 | |
|
35 | 35 | scope :like, lambda {|q| |
|
36 | 36 | q = q.to_s |
@@ -57,7 +57,7 class Principal < ActiveRecord::Base | |||
|
57 | 57 | where("1=0") |
|
58 | 58 | else |
|
59 | 59 | ids = projects.map(&:id) |
|
60 |
where(" |
|
|
60 | active.where("#{Principal.table_name}.id IN (SELECT DISTINCT user_id FROM #{Member.table_name} WHERE project_id IN (?))", ids) | |
|
61 | 61 | end |
|
62 | 62 | } |
|
63 | 63 | # Principals that are not members of projects |
General Comments 0
You need to be logged in to leave comments.
Login now