Browse Source

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
tags/4.2.0
Toshi MARUYAMA 3 years ago
parent
commit
e8785b7ac2
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      app/models/role.rb

+ 2
- 2
app/models/role.rb 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

Loading…
Cancel
Save