use "do end" instead of {} at ActiveRecord scope lambda of app/models/role.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@20345 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2020-11-12 12:31:43 +00:00
parent b7d44c8b19
commit e8785b7ac2

View File

@@ -55,10 +55,10 @@ class Role < ActiveRecord::Base
scope :sorted, lambda {order(:builtin, :position)}
scope :givable, lambda {order(:position).where(:builtin => 0)}
scope :builtin, lambda { |*args|
scope :builtin, (lambda do |*args|
compare = (args.first == true ? 'not' : '')
where("#{compare} builtin = 0")
}
end)
before_destroy :check_deletable
has_many :workflow_rules, :dependent => :delete_all