Browse Source

fix: team user build use find or create by

tags/v4.0.0^2
yystopf 4 years ago
parent
commit
237b0afb08
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/models/team_user.rb

+ 1
- 1
app/models/team_user.rb View File

@@ -29,7 +29,7 @@ class TeamUser < ApplicationRecord
before_destroy :remove_project_member

def self.build(organization_id, user_id, team_id)
self.create!(organization_id: organization_id, user_id: user_id, team_id: team_id)
self.find_or_create_by!(organization_id: organization_id, user_id: user_id, team_id: team_id)
end

def remove_project_member


Loading…
Cancel
Save