module Admin
  class EducatorsController < Admin::ApplicationController
    # To customize the behavior of this controller,
    # simply overwrite any of the RESTful actions.

    def index
      @_order = Administrate::Order.new(:full_name)
      super
    end

    def edit
      @valid_grades = %w(PK KF SP 1 2 3 4 5 6 7 8 9 10 11 12)
      super
    end

    def resource_params
      params["educator"]["grade_level_access"] = params["educator"]["grade_level_access"].try(:keys) || []

      params.require("educator").permit(*dashboard.permitted_attributes, grade_level_access: [])
    end

  end
end

module Admin
  class EducatorsController < Admin::ApplicationController
    # To customize the behavior of this controller,
    # simply overwrite any of the RESTful actions.

    def index
      @_order = Administrate::Order.new(:full_name)
      super
    end

    def edit
      @valid_grades = %w(PK KF SP 1 2 3 4 5 6 7 8 9 10 11 12)
      super
    end

    def update
      # TODO (ARS): re-compute student searchbar JSON once permissions are updated
      super
    end

    def resource_params
      params["educator"]["grade_level_access"] = params["educator"]["grade_level_access"].try(:keys) || []

      params.require("educator").permit(*dashboard.permitted_attributes, grade_level_access: [])
    end

  end
end

Add note about TODO step, updating searchbar data after permissions are adjusted in dashboard
Add note about TODO step, updating searchbar data after permissions are adjusted in dashboard
