From 2d6f552599d0e632953372b7a942a5eaab099631 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 14 Mar 2022 14:25:24 +0000 Subject: 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 --- app/models/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/project.rb') 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, -- cgit v1.2.3