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"].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 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

Handle case where grade level access is empty
Handle case where grade level access is empty

+ Can't access the "keys" of a split string if the string was nil; grade level access can't be nil, must be []
+ TODO:
  + [ ] Think about a more elegant / less hacky way to do this
  + [ ] Write a system test now that we're on Rails 5.1 and that kind of thing is easier?
