diff options
author | Go MAEDA <maeda@farend.jp> | 2023-06-29 01:37:24 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-06-29 01:37:24 +0000 |
commit | 0befc3a23cf37565878629af13f704fc5730d9fb (patch) | |
tree | 604bb6ec168d2f09fe823518dd1f30a5817a6abf /app/models | |
parent | e0e751f5bc07c2ad397ebb5b0ab28d802872a602 (diff) | |
download | redmine-0befc3a23cf37565878629af13f704fc5730d9fb.tar.gz redmine-0befc3a23cf37565878629af13f704fc5730d9fb.zip |
Fix RuboCop offense Style/RedundantSelfAssignmentBranch (#36919).
git-svn-id: https://svn.redmine.org/redmine/trunk@22263 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index a50fa8807..5f45896fc 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -928,7 +928,7 @@ class Project < ActiveRecord::Base # project.copy(1, :only => 'members') # => copies members only # project.copy(1, :only => ['members', 'versions']) # => copies members and versions def copy(project, options={}) - project = project.is_a?(Project) ? project : Project.find(project) + project = Project.find(project) unless project.is_a?(Project) to_be_copied = %w(members wiki versions issue_categories issues queries boards documents) to_be_copied = to_be_copied & Array.wrap(options[:only]) unless options[:only].nil? @@ -956,7 +956,7 @@ class Project < ActiveRecord::Base # Returns a new unsaved Project instance with attributes copied from +project+ def self.copy_from(project) - project = project.is_a?(Project) ? project : Project.find(project) + project = Project.find(project) unless project.is_a?(Project) # clear unique attributes attributes = project.attributes.dup.except('id', 'name', 'identifier', |