@ -1,6 +1,6 @@
class DepartmentsController < ApplicationController
def for_option
render_ok(departments: current_school.departments.select(:id, :name).as_json)
render_ok(departments: current_school.departments.without_deleted.select(:id, :name).as_json)
end
private
@ -2,4 +2,6 @@ class Department < ApplicationRecord
belongs_to :school
has_many :department_members, dependent: :destroy
scope :without_deleted, -> { where(is_delete: false) }