-
Notifications
You must be signed in to change notification settings - Fork 5
Create models and controllers for lessons #241
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
Closed
create-issue-branch
wants to merge
126
commits into
main
from
issues/239-Create_models_and_controllers_for_lessons
Closed
Create models and controllers for lessons #241
create-issue-branch
wants to merge
126
commits into
main
from
issues/239-Create_models_and_controllers_for_lessons
Conversation
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
The #stub_fetch_oauth_user methods seems superfluous since we can already stub HydraPublicApi requests at the HTTP level. This exercises more of the code so I think it’s better to remove this method.
As part of the verification flow, the user should have accepted the responsibilities of a school owner by the time they come to create the school. We need make sure we assign the school-owner role to them at this point, which would also require the organisation to be created so that we can assign the organisation_id on the Assignment in profile.
In England, this will hold the URN of the school. We don’t know whether this will be available in all countries so allow null values but insist that it is unique if provided.
This avoids having to include Identifiable in controllers since we already have a user available via the #current_user method.
Although this API doesn’t exist yet, call the client in the relevant parts of the code so that we would assign the organisation_id to the school that is being created. I think it makes sense for the creation of the organisation to happen after we’ve sense checked that the school is valid, to avoid creating unnecessary organisations in the profile app. We could create the organisations earlier in the flow and then enforce the presence of the ‘school-owner’ role via CanCanCan but I think it’s better to try and make this as transactional as possible.
For consistency with projects.remixed_from_id
A project can have an optional school association, e.g. if it is a member of a school’s library of resources or if it is assigned to a lesson.
If the user has the school-owner or school-teacher role, they can create a project that is associated with a school (but not a school class). If the user is a school-owner they can assign a teacher to the project in the same was as lessons, otherwise the school-teacher is always set as the project’s owner (user).
…(if present) With regards to students creating projects relating to a lesson, I think they should just remix the project created by the teacher and not associate it with the lesson directly to make it easier to distinguish which is the actual project for a lesson, rather than a version created by a student.
5bbf441
to
cc13ea8
Compare
sra405
reviewed
Mar 6, 2024
Comment on lines
+5
to
+6
has_many :lessons, dependent: :nullify | ||
has_many :projects, dependent: :nullify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ dependency between schools, classes, lessons, projects all currently have dependent: :nullify
- ensure this is the correct behaviour and in line with the agreed data retention approach
This was referenced Apr 11, 2024
Superseded by #258. Closing. |
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.
closes #239