From: Toshi MARUYAMA Date: Tue, 10 Nov 2020 11:09:54 +0000 (+0000) Subject: remove spaces inside {} of app/models/role.rb X-Git-Tag: 4.2.0~494 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3a0b7d6a2f03d80abcde82269dd0abe40993fb69;p=redmine.git remove spaces inside {} of app/models/role.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20324 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/role.rb b/app/models/role.rb index bd3c0662d..7d0f65b43 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -53,8 +53,8 @@ class Role < ActiveRecord::Base ['members_of_visible_projects', :label_users_visibility_members_of_visible_projects] ] - scope :sorted, lambda { order(:builtin, :position) } - scope :givable, lambda { order(:position).where(:builtin => 0) } + scope :sorted, lambda {order(:builtin, :position)} + scope :givable, lambda {order(:position).where(:builtin => 0)} scope :builtin, lambda { |*args| compare = (args.first == true ? 'not' : '') where("#{compare} builtin = 0") @@ -117,7 +117,7 @@ class Role < ActiveRecord::Base end def permissions=(perms) - perms = perms.collect {|p| p.to_sym unless p.blank? }.compact.uniq if perms + perms = perms.collect {|p| p.to_sym unless p.blank?}.compact.uniq if perms write_attribute(:permissions, perms) end @@ -136,7 +136,7 @@ class Role < ActiveRecord::Base return unless permissions.is_a?(Array) permissions_will_change! - perms.each { |p| permissions.delete(p.to_sym) } + perms.each {|p| permissions.delete(p.to_sym)} save! end