summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-21 10:09:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-21 10:09:13 +0000
commit2ec53dd2952e67d1b6609fa8279e4b00d32ac339 (patch)
tree9a12ac56b0089b4b7fa7da9d4185de02d318dc8d /app/models
parentc283212f9fa6fb5ad328511a7230adf9b3ba8917 (diff)
downloadredmine-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.rb6
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}