From: Toshi MARUYAMA Date: Tue, 10 Nov 2020 11:10:01 +0000 (+0000) Subject: use "do end" instead of {} at ActiveRecord scope lambda of app/models/member.rb X-Git-Tag: 4.2.0~493 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=13abe5b003a6f20551d6fffbe0b5515411926560;p=redmine.git use "do end" instead of {} at ActiveRecord scope lambda of app/models/member.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20325 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/member.rb b/app/models/member.rb index f5d77e87d..c04d139c9 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -33,15 +33,15 @@ class Member < ActiveRecord::Base scope :active, lambda { joins(:principal).where(:users => {:status => Principal::STATUS_ACTIVE})} # Sort by first role and principal - scope :sorted, lambda { + scope :sorted, (lambda do includes(:member_roles, :roles, :principal). reorder("#{Role.table_name}.position"). order(Principal.fields_for_order_statement) - } - scope :sorted_by_project, lambda { + end) + scope :sorted_by_project, (lambda do includes(:project). reorder("#{Project.table_name}.lft") - } + end) alias :base_reload :reload def reload(*args)