diff options
author | Go MAEDA <maeda@farend.jp> | 2022-03-14 14:25:24 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-03-14 14:25:24 +0000 |
commit | 2d6f552599d0e632953372b7a942a5eaab099631 (patch) | |
tree | 7f5efa62f8ecb0d4a27623c4ce09ca8b1662567d /app/models/project.rb | |
parent | d15d23b7ac878ff3d0feff64051a0be0ce8a10fd (diff) | |
download | redmine-2d6f552599d0e632953372b7a942a5eaab099631.tar.gz redmine-2d6f552599d0e632953372b7a942a5eaab099631.zip |
Replace Member.find_or_new with ActiveRecord's find_or_initialize_by (#36730).
git-svn-id: http://svn.redmine.org/redmine/trunk@21456 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 4e15b19c8..90ef0e2e9 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1001,7 +1001,7 @@ class Project < ActiveRecord::Base def add_inherited_member_roles if inherit_members? && parent parent.memberships.each do |parent_member| - member = Member.find_or_new(self.id, parent_member.user_id) + member = Member.find_or_initialize_by(:project_id => self.id, :user_id => parent_member.user_id) parent_member.member_roles.each do |parent_member_role| member.member_roles << MemberRole.new(:role => parent_member_role.role, |