From: Toshi MARUYAMA Date: Mon, 9 Nov 2020 13:25:10 +0000 (+0000) Subject: use "do end" instead of {} at ActiveRecord scope lambda of app/models/query.rb X-Git-Tag: 4.2.0~501 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=96acbee6d3f85fd2826ca1c30b6cd703f7bed8a7;p=redmine.git use "do end" instead of {} at ActiveRecord scope lambda of app/models/query.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20317 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/query.rb b/app/models/query.rb index 5f69f56ac..44b3adca3 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -313,9 +313,9 @@ class Query < ActiveRecord::Base class_attribute :view_permission # Scope of queries that are global or on the given project - scope :global_or_on_project, lambda {|project| + scope :global_or_on_project, (lambda do |project| where(:project_id => (project.nil? ? nil : [nil, project.id])) - } + end) scope :sorted, lambda {order(:name, :id)}