Skip to content

Add flag to identify school as linked to excs #546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

danhalson
Copy link
Contributor

Status

Points for consideration:

  • Security
  • Performance

What's changed?

  • Adds user_origin enum to capture user origin
  • Adds a school template to make views more DRY

Steps to perform after deploying to production

N/A

@danhalson danhalson self-assigned this May 19, 2025
@cla-bot cla-bot bot added the cla-signed label May 19, 2025
@danhalson danhalson temporarily deployed to editor-api-p-issues-543-6fnqly May 19, 2025 17:15 Inactive
@danhalson danhalson requested a review from Copilot May 19, 2025 17:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new user_origin enum to the School model and refactors the API views to include this field via a shared Jbuilder partial.

  • Introduces user_origin column, enum, and model validations
  • Updates strong parameters and feature/spec tests to handle user_origin
  • Refactors show/index views to use a _school.json.jbuilder partial, including the new field

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
spec/models/school_spec.rb Added tests for user_origin presence and default
spec/features/school/creating_a_school_spec.rb Included user_origin in feature spec payload
db/schema.rb Bumped schema version and added user_origin field
db/migrate/20250515081023_add_connected_apps_table.rb Migration adds user_origin but has a misleading name
app/models/school.rb Defines user_origin enum with default and validate
app/controllers/api/schools_controller.rb Permits user_origin in strong parameters
app/views/api/schools/show.json.jbuilder Switched to partial with user_origin: true
app/views/api/schools/index.json.jbuilder Switched to partial but missing user_origin
app/views/api/schools/_school.json.jbuilder New partial renders user_origin when requested
app/views/api/my_school/show.json.jbuilder Switched to partial but omits user_origin
app/views/api/school_owners/_school_owner.json.jbuilder Minor whitespace cleanup
Comments suppressed due to low confidence (1)

db/migrate/20250515081023_add_connected_apps_table.rb:1

  • The migration name and class suggest adding a connected apps table, but it only adds a user_origin column to schools. Consider renaming the file and class to AddUserOriginToSchools for clarity.
class AddConnectedAppsTable < ActiveRecord::Migration[7.1]

@danhalson danhalson temporarily deployed to editor-api-p-issues-543-6fnqly May 21, 2025 06:42 Inactive
@danhalson danhalson temporarily deployed to editor-api-p-issues-543-6fnqly May 23, 2025 14:18 Inactive
Copy link
Contributor

@loiswells97 loiswells97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, let's get this out there! 🚀

@danhalson danhalson merged commit b680b79 into main May 24, 2025
3 checks passed
@danhalson danhalson deleted the issues/543-Add_flag_to_identify_school_as_linked_to_ExCS branch May 24, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add flag to identify school as linked to ExCS
2 participants