##// END OF EJS Templates
Clean up SQL....
Jean-Philippe Lang -
r15864:2ec53dd2952e
parent child
Show More
@@ -79,13 +79,13 class Issue < ActiveRecord::Base
79 79 scope :open, lambda {|*args|
80 80 is_closed = args.size > 0 ? !args.first : false
81 81 joins(:status).
82 where("#{IssueStatus.table_name}.is_closed = ?", is_closed)
82 where(:issue_statuses => {:is_closed => is_closed})
83 83 }
84 84
85 scope :recently_updated, lambda { order("#{Issue.table_name}.updated_on DESC") }
85 scope :recently_updated, lambda { order(:updated_on => :desc) }
86 86 scope :on_active_project, lambda {
87 87 joins(:project).
88 where("#{Project.table_name}.status = ?", Project::STATUS_ACTIVE)
88 where(:projects => {:status => Project::STATUS_ACTIVE})
89 89 }
90 90 scope :fixed_version, lambda {|versions|
91 91 ids = [versions].flatten.compact.map {|v| v.is_a?(Version) ? v.id : v}
General Comments 0
You need to be logged in to leave comments. Login now