app/models/volunteer.rb
def deactivate
    transaction do
      updated = update(active: false)
      if updated
        case_assignments.update_all(is_active: false)
      end

      updated
    end
  end
# Deactivates this volunteer and all of their case assignments.
Deactivates this volunteer and all of their case assignments.
Deactivates this volunteer and all of their case assignments .
def deactivate
    transaction do
      updated = update(active: false)
      if updated
        case_assignments.update_all(is_active: false)
      end
      updated
    end
  end
def deactivate transaction do updated = update ( active : false ) if updated case_assignments . update_all ( is_active : false ) end updated end end
Deactivates this volunteer and all of their case assignments.
Deactivates this volunteer and all of their case assignments .