Conversation
Test coverage90.13% line coverage reported by SimpleCov. |
There was a problem hiding this comment.
Pull request overview
Implements Scratch asset persistence and retrieval in the API using ActiveStorage, aligning with the referenced ADR for Scratch project storage and enabling save/load of uploaded assets.
Changes:
- Added
ScratchAssetmodel + DB table for storing asset metadata and attaching uploaded files via ActiveStorage. - Implemented Scratch asset
show(redirect to blob) andcreate(store-once upload) endpoints and updated routes to include optionalformat. - Added request specs and a factory for creating Scratch assets with attachments; added middleware + gem to default content-type for binary uploads.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/features/scratch/showing_a_scratch_asset_spec.rb | Removes old placeholder “show SVG” request spec. |
| spec/features/scratch/creating_and_showing_a_scratch_asset_spec.rb | Adds request specs covering asset create + show redirect behavior. |
| spec/factories/scratch_assets.rb | Adds a scratch_asset factory with an attached fixture file. |
| db/schema.rb | Includes new scratch_assets table in schema. |
| db/migrate/20260310161646_create_scratch_assets.rb | Adds migration to create scratch_assets. |
| config/routes.rb | Updates Scratch asset create route to accept .:format. |
| config/application.rb | Inserts middleware to default POST content-type for scratch asset uploads. |
| app/models/scratch_asset.rb | Introduces ScratchAsset model with attachment and validations. |
| app/controllers/api/scratch/assets_controller.rb | Implements show redirect and create upload logic for assets. |
| Gemfile.lock | Adds rack_content_type_default dependency resolution. |
| Gemfile | Adds rack_content_type_default (and relocates flipper-ui). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
spec/features/scratch/creating_and_showing_a_scratch_asset_spec.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
zetter-rpf
left a comment
There was a problem hiding this comment.
Fantastic, no suggestions from me.
|
Thanks @zetter-rpf, won't merge just yet as I'd like to see what else is needed for ActiveStorage to use e.g. S3 on staging. |
Looks like this should work as-is, so I will merge once we've deployed the other stuff and cleared the Staging column. |
Status
Points for consideration:
What's changed?
showandcreatefor Scratch assets using ActiveStorage.