def build_user_roles(params)
      @roles.each do |role|
        role = role.tableize.singularize
        klass_name = "Roles::#{role.classify}"
        if (params[:user][:user_roles][role] == "1") &&
           !@user.user_roles.map(&:role_class_name).include?(klass_name)
          @user.user_roles.build(role_class_name: klass_name)
        elsif (params[:user][:user_roles][role] == "0") &&
              @user.user_roles.map(&:role_class_name).include?(klass_name)
          user_role = @user.user_roles.find_by_role_class_name(klass_name)
          user_role.destroy
        end
      end
    end
def build_user_roles(params)
      @roles.each do |role|
        role = role.tableize.singularize
        klass_name = "Roles::#{role.classify}"
        if (params[:user][:user_roles][role] == "1") &&
           !@user.user_roles.map(&:role_class_name).include?(klass_name)
          @user.user_roles.build(role_class_name: klass_name)
        elsif (params[:user][:user_roles][role] == "0") &&
              @user.user_roles.map(&:role_class_name).include?(klass_name)
          user_role = @user.user_roles.find_by_role_class_name(klass_name)
          user_role.destroy
        end
      end
    end
TODO: refactor
 rubocop:disable Metrics/AbcSize