app/models/members/project_member.rb
def add_users_to_projects(project_ids, users, access_level, current_user: nil, expires_at: nil)
      self.transaction do
        project_ids.each do |project_id|
          project = Project.find(project_id)

          add_users(
            project,
            users,
            access_level,
            current_user: current_user,
            expires_at: expires_at
          )
        end
      end
    end
# Add users to projects with passed access option
#
# access can be an integer representing a access code
# or symbol like :master representing role
#
# Ex.
#   add_users_to_projects(
#     project_ids,
#     user_ids,
#     ProjectMember::MASTER
#   )
#
#   add_users_to_projects(
#     project_ids,
#     user_ids,
#     :master
#   )
#
Add users to projects with passed access option
access can be an integer representing a access code
or symbol like :master representing role

Ex.


Add users to projects with passed access option access can be an integer representing a access code or symbol like : master representing role Ex .
def add_users_to_projects(project_ids, users, access_level, current_user: nil, expires_at: nil)
      self.transaction do
        project_ids.each do |project_id|
          project = Project.find(project_id)
          add_users(
            project,
            users,
            access_level,
            current_user: current_user,
            expires_at: expires_at
          )
        end
      end
    end
def add_users_to_projects ( project_ids , users , access_level , current_user : nil , expires_at : nil ) self . transaction do project_ids . each do | project_id | project = Project . find ( project_id ) add_users ( project , users , access_level , current_user : current_user , expires_at : expires_at ) end end end
Add users to projects with passed access option
access can be an integer representing a access code
or symbol like :master representing role
Add users to projects with passed access option access can be an integer representing a access code or symbol like : master representing role
project_ids
users
access_level
current_user
expires_at