]> source.dussan.org Git - redmine.git/commitdiff
use "do end" instead of {} at ActiveRecord scope lambda of app/models/version.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 12 Nov 2020 12:31:27 +0000 (12:31 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 12 Nov 2020 12:31:27 +0000 (12:31 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20343 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/version.rb

index 1f235e0ea45118b2db8a84b44bfed7320d5f7524..8bdb926a53ee7eab98550790c035364ab007d310 100644 (file)
@@ -135,22 +135,22 @@ class Version < ActiveRecord::Base
   validates_inclusion_of :sharing, :in => VERSION_SHARINGS
 
   scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)}
-  scope :like, lambda {|arg|
+  scope :like, (lambda do |arg|
     if arg.present?
       pattern = "%#{arg.to_s.strip}%"
       where([Redmine::Database.like("#{Version.table_name}.name", '?'), pattern])
     end
-  }
+  end)
   scope :open, lambda {where(:status => 'open')}
-  scope :status, lambda {|status|
+  scope :status, (lambda do |status|
     if status.present?
       where(:status => status.to_s)
     end
-  }
-  scope :visible, lambda {|*args|
+  end)
+  scope :visible, (lambda do |*args|
     joins(:project).
     where(Project.allowed_to_condition(args.first || User.current, :view_issues))
-  }
+  end)
 
   safe_attributes 'name',
                   'description',