diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-09-26 15:01:28 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-09-26 15:01:28 +0000 |
commit | ec488e63794b8bb79a080d16d5ce211b47cbc7c8 (patch) | |
tree | e2cdce1f65bc47be068ecbb46acd3f2890faed54 | |
parent | 2c9f822be9613a86ca69d2afcadd724ac61b86a0 (diff) | |
download | redmine-ec488e63794b8bb79a080d16d5ce211b47cbc7c8.tar.gz redmine-ec488e63794b8bb79a080d16d5ce211b47cbc7c8.zip |
use "do end" instead of {} at app/models/project.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20079 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/models/project.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 5fd3c4a0c..839e39a28 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -780,7 +780,7 @@ class Project < ActiveRecord::Base safe_attributes( 'enabled_module_names', :if => - lambda {|project, user| + lambda do |project, user| if project.new_record? if user.admin? true @@ -790,7 +790,8 @@ class Project < ActiveRecord::Base else user.allowed_to?(:select_project_modules, project) end - }) + end + ) safe_attributes( 'inherit_members', @@ -1041,7 +1042,10 @@ class Project < ActiveRecord::Base new_issue.project = self # Changing project resets the custom field values # TODO: handle this in Issue#project= - new_issue.custom_field_values = issue.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h} + new_issue.custom_field_values = issue.custom_field_values.inject({}) do |h, v| + h[v.custom_field_id] = v.value + h + end # Reassign fixed_versions by name, since names are unique per project if issue.fixed_version && issue.fixed_version.project == project new_issue.fixed_version = self.versions.detect {|v| v.name == issue.fixed_version.name} @@ -1183,7 +1187,9 @@ class Project < ActiveRecord::Base end def allowed_actions - @actions_allowed ||= allowed_permissions.inject([]) { |actions, permission| actions += Redmine::AccessControl.allowed_actions(permission) }.flatten + @actions_allowed ||= allowed_permissions.inject([]) do |actions, permission| + actions += Redmine::AccessControl.allowed_actions(permission) + end.flatten end # Archives subprojects recursively |