diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-01-21 10:09:13 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-01-21 10:09:13 +0000 |
commit | 2ec53dd2952e67d1b6609fa8279e4b00d32ac339 (patch) | |
tree | 9a12ac56b0089b4b7fa7da9d4185de02d318dc8d /app/models | |
parent | c283212f9fa6fb5ad328511a7230adf9b3ba8917 (diff) | |
download | redmine-2ec53dd2952e67d1b6609fa8279e4b00d32ac339.tar.gz redmine-2ec53dd2952e67d1b6609fa8279e4b00d32ac339.zip |
Clean up SQL.
git-svn-id: http://svn.redmine.org/redmine/trunk@16246 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/issue.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 00e98995d..40a12c0ca 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -79,13 +79,13 @@ class Issue < ActiveRecord::Base scope :open, lambda {|*args| is_closed = args.size > 0 ? !args.first : false joins(:status). - where("#{IssueStatus.table_name}.is_closed = ?", is_closed) + where(:issue_statuses => {:is_closed => is_closed}) } - scope :recently_updated, lambda { order("#{Issue.table_name}.updated_on DESC") } + scope :recently_updated, lambda { order(:updated_on => :desc) } scope :on_active_project, lambda { joins(:project). - where("#{Project.table_name}.status = ?", Project::STATUS_ACTIVE) + where(:projects => {:status => Project::STATUS_ACTIVE}) } scope :fixed_version, lambda {|versions| ids = [versions].flatten.compact.map {|v| v.is_a?(Version) ? v.id : v} |