summaryrefslogtreecommitdiffstats
path: root/app/models/role.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-29 21:49:33 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-29 21:49:33 +0000
commit522bebe5edbe302ab3e51a64e163877c3ca5eab6 (patch)
treeb130ef847cf1e3563bf4409b8d0e9c6d6781b93d /app/models/role.rb
parent47e74dc689811a1170db4df07ea64d1176ed5a52 (diff)
downloadredmine-522bebe5edbe302ab3e51a64e163877c3ca5eab6.tar.gz
redmine-522bebe5edbe302ab3e51a64e163877c3ca5eab6.zip
Order scopes cleanup.
git-svn-id: http://svn.redmine.org/redmine/trunk@13526 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/role.rb')
-rw-r--r--app/models/role.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/role.rb b/app/models/role.rb
index efd9a334d..31dbf75a1 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -39,8 +39,8 @@ class Role < ActiveRecord::Base
['own', :label_issues_visibility_own]
]
- scope :sorted, lambda { order("#{table_name}.builtin ASC, #{table_name}.position ASC") }
- scope :givable, lambda { order("#{table_name}.position ASC").where(:builtin => 0) }
+ scope :sorted, lambda { order(:builtin, :position) }
+ scope :givable, lambda { order(:position).where(:builtin => 0) }
scope :builtin, lambda { |*args|
compare = (args.first == true ? 'not' : '')
where("#{compare} builtin = 0")