Allow Scratch projects to be created by ExCS clients - #1009
Open
zetter-rpf wants to merge 1 commit into
Open
Conversation
Currently if a school doesn't have the blocks editor enabled they are unable to add migrated ExCS projects. This allows any client to create scratch projects, even if the School does not have Scratch enabled. I think this is fine as schools without this enabled still won't see the button to add Scratch projects. Even if we did restrict it to ExCS projects in some way, clients could add those projects and then edit them however they want making the restriction useless. Since we plan on removing the beta flag soon anyway I think it's simpler to loosen the restriction.
zetter-rpf
marked this pull request as ready for review
September 9, 2026 16:13
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes consistently remove the Scratch-enabled restriction across controllers and align the request specs with the updated intended behavior.
Pull request overview
This PR removes the server-side “Scratch enabled” gate for lesson creation so Experience CS (and any other) clients can create Scratch-backed lesson projects even when a school hasn’t enabled Scratch.
Changes:
- Removed the
scratch_enabledauthorization check from lesson create/create_copy and lesson batch creation endpoints. - Deleted request specs that expected
403 Forbiddenwhenscratch_enabledis false, and updated remaining specs to reflect the new behavior. - Removed now-unused helper methods from
LessonCreation.
File summaries
| File | Description |
|---|---|
| spec/features/lesson/creating_a_lesson_spec.rb | Updates lesson creation specs to allow Scratch lesson creation without requiring scratch_enabled. |
| spec/features/lesson/creating_a_batch_of_lessons_spec.rb | Updates batch lesson creation specs to remove scratch_enabled setup and “forbidden” expectations. |
| app/controllers/concerns/lesson_creation.rb | Removes Scratch gate helper methods that enforced the scratch_enabled restriction. |
| app/controllers/api/lessons/batch_controller.rb | Removes the before_action that blocked Scratch lesson batch creation when Scratch wasn’t enabled. |
| app/controllers/api/lessons_controller.rb | Removes the before_action that blocked Scratch lesson creation/copy when Scratch wasn’t enabled. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Test coverage93.55% line coverage reported by SimpleCov. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
What's changed?
Currently if a school doesn't have the blocks editor enabled they are unable to add migrated ExCS projects.
This cuahge allows any client to create scratch projects, even if the School does not have Scratch enabled.