diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-23 17:22:32 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-23 17:22:32 +0000 |
commit | 41d81a09b36595f129e3c798d9caa525becacc8d (patch) | |
tree | 7d047849884bdf468f4d6944ce359cdfcac25d8f /app/models/tracker.rb | |
parent | 44a5eedf8f04a5908d1c479488368688d2a666ef (diff) | |
download | redmine-41d81a09b36595f129e3c798d9caa525becacc8d.tar.gz redmine-41d81a09b36595f129e3c798d9caa525becacc8d.zip |
Use regular AR query instead of raw SQL.
git-svn-id: http://svn.redmine.org/redmine/trunk@13496 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/tracker.rb')
-rw-r--r-- | app/models/tracker.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/app/models/tracker.rb b/app/models/tracker.rb index b4f22c811..bf8a08f20 100644 --- a/app/models/tracker.rb +++ b/app/models/tracker.rb @@ -59,11 +59,8 @@ class Tracker < ActiveRecord::Base return [] end - ids = WorkflowTransition. - connection.select_rows("SELECT DISTINCT old_status_id, new_status_id FROM #{WorkflowTransition.table_name} WHERE tracker_id = #{id} AND type = 'WorkflowTransition'"). - flatten. - uniq - @issue_statuses = IssueStatus.where(:id => ids).to_a.sort + status_ids = WorkflowTransition.where(:tracker_id => id).uniq.pluck(:old_status_id, :new_status_id).flatten.uniq + @issue_statuses = IssueStatus.where(:id => status_ids).to_a.sort end def disabled_core_fields |