1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

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

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

View File

@ -51,7 +51,7 @@ class Tracker < ActiveRecord::Base
# #
# Tracker.visible(user) # Tracker.visible(user)
# => returns the trackers that are visible by the user in at least on project # => returns the trackers that are visible by the user in at least on project
scope :visible, lambda {|*args| scope :visible, (lambda do |*args|
user = args.shift || User.current user = args.shift || User.current
condition = Project.allowed_to_condition(user, :view_issues) do |role, user| condition = Project.allowed_to_condition(user, :view_issues) do |role, user|
unless role.permissions_all_trackers?(:view_issues) unless role.permissions_all_trackers?(:view_issues)
@ -64,7 +64,7 @@ class Tracker < ActiveRecord::Base
end end
end end
joins(:projects).where(condition).distinct joins(:projects).where(condition).distinct
} end)
safe_attributes( safe_attributes(
'name', 'name',