1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-29 03:39:38 +00:00

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

git-svn-id: http://svn.redmine.org/redmine/trunk@20343 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2020-11-12 12:31:27 +00:00
parent 4ce729d5af
commit 581fb1f96d

View 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',