Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions app/controllers/api/schools_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@ def update
end
end

def destroy
result = School::Delete.call(school_id: params[:id])

if result.success?
head :no_content
else
render json: { error: result[:error] }, status: :unprocessable_content
end
end

def import
authorize! :import, School

Expand Down
2 changes: 1 addition & 1 deletion app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def define_authenticated_non_student_abilities(user)
end

def define_school_owner_abilities(school:)
can(%i[read update destroy], School, id: school.id)
can(%i[read update], School, id: school.id)
can(%i[read], :school_member)
can(%i[read create import update destroy regenerate_join_code], SchoolClass, school: { id: school.id })
can(%i[read update show_context], Project, school_id: school.id, lesson: { visibility: %w[teachers students] })
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
resource :project_errors, only: %i[create]

resource :school, only: [:show], controller: 'my_school'
resources :schools, only: %i[index show create update destroy] do
resources :schools, only: %i[index show create update] do
post :import, on: :collection
resources :members, only: %i[index], controller: 'school_members'
resources :classes, only: %i[index show create update destroy], controller: 'school_classes' do
Expand Down
24 changes: 0 additions & 24 deletions lib/concepts/school/operations/delete.rb

This file was deleted.

59 changes: 0 additions & 59 deletions spec/concepts/school/delete_spec.rb

This file was deleted.

47 changes: 0 additions & 47 deletions spec/features/school/deleting_a_school_spec.rb

This file was deleted.

1 change: 0 additions & 1 deletion spec/models/ability_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@

it { is_expected.to be_able_to(:read, school) }
it { is_expected.to be_able_to(:update, school) }
Comment thread
zetter-rpf marked this conversation as resolved.
it { is_expected.to be_able_to(:destroy, school) }

it 'cannot interact with an inactive school' do
school.update!(archived_at: Time.current)
Expand Down
Loading