app/models/members/project_member.rb
# Add users to projects with passed access option
#
# access can be an integer representing a access code
# or symbol like :maintainer representing role
#
# Ex.
#   add_users_to_projects(
#     project_ids,
#     user_ids,
#     ProjectMember::MAINTAINER
#   )
#
#   add_users_to_projects(
#     project_ids,
#     user_ids,
#     :maintainer
#   )
#
Add users to projects with passed access option
access can be an integer representing a access code
or symbol like :maintainer representing role

Ex.


Add users to projects with passed access option access can be an integer representing a access code or symbol like : maintainer representing role Ex .
def truncate_teams(project_ids)
      ProjectMember.transaction do
        members = ProjectMember.where(source_id: project_ids)
        members.each do |member|
          member.destroy
        end
      end
      true
    rescue
      false
    end
def truncate_teams ( project_ids ) ProjectMember . transaction do members = ProjectMember . where ( source_id : project_ids ) members . each do | member | member . destroy end end true rescue false end
Add users to projects with passed access option
access can be an integer representing a access code
or symbol like :maintainer representing role
Add users to projects with passed access option access can be an integer representing a access code or symbol like : maintainer representing role
project_ids