summaryrefslogtreecommitdiffstats
path: root/app/models/role.rb
diff options
context:
space:
mode:
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2012-12-07 10:12:47 +0000
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2012-12-07 10:12:47 +0000
commit4896d5c7e83bb3cc7996c5ab09441c90e7cd9ce1 (patch)
treed3fabb5ab5a156ec53e28ebf938f03ddc165815a /app/models/role.rb
parent8201761e7732faa3933899653de5951dcbd6b27c (diff)
downloadredmine-4896d5c7e83bb3cc7996c5ab09441c90e7cd9ce1.tar.gz
redmine-4896d5c7e83bb3cc7996c5ab09441c90e7cd9ce1.zip
Use lambda form in model scopes (#12499)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10949 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 15ed0e10d..d393582c0 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, order("#{table_name}.builtin ASC, #{table_name}.position ASC")
- scope :givable, order("#{table_name}.position ASC").where(:builtin => 0)
+ scope :sorted, lambda { order("#{table_name}.builtin ASC, #{table_name}.position ASC") }
+ scope :givable, lambda { order("#{table_name}.position ASC").where(:builtin => 0) }
scope :builtin, lambda { |*args|
compare = (args.first == true ? 'not' : '')
where("#{compare} builtin = 0")