Open
Conversation
7e581ee to
7498263
Compare
WIP: work on course_settings WIP: continued work on the course settings WIP: continued work on course_settings. TEST: mojolicious route testing for settings. WIP: continued work on course settings
WIP: allow default settings to be defined in an override file.
WIP: fix up tests and general cleanup. WIP: fix up tests and general cleanup.
FIX: fixes after rebasing.
7498263 to
9c1d4cc
Compare
drdrew42
reviewed
Aug 28, 2022
Member
drdrew42
left a comment
There was a problem hiding this comment.
Many-to-many relationships are also pluralized.
| # set up the many-to-many relationship to users | ||
| __PACKAGE__->has_many(course_users => 'DB::Schema::Result::CourseUser', 'course_id'); | ||
| __PACKAGE__->many_to_many(users => 'course_users', 'users'); | ||
| __PACKAGE__->many_to_many(users => 'course_users', 'user'); |
Member
Author
There was a problem hiding this comment.
I was using the example in https://metacpan.org/pod/DBIx::Class::Relationship#many_to_many
It seems that the 3rd argument is the same as the belongs_to in the bridging table. I don't think this is an accessor name. The example cited above used singular for this relationship (actor and role).
| __PACKAGE__->set_primary_key('db_perm_id'); | ||
| __PACKAGE__->has_many(db_perm_roles => 'DB::Schema::Result::DBPermRole', 'db_perm_id'); | ||
| __PACKAGE__->many_to_many(roles => 'db_perm_roles', 'roles'); | ||
| __PACKAGE__->many_to_many(roles => 'db_perm_roles', 'role'); |
|
|
||
| __PACKAGE__->has_many(db_perm_roles => 'DB::Schema::Result::DBPermRole', 'role_id'); | ||
| __PACKAGE__->many_to_many(db_perms => 'db_perm_roles', 'db_perms'); | ||
| __PACKAGE__->many_to_many(db_permissions => 'db_perm_roles', 'db_permission'); |
|
|
||
| __PACKAGE__->has_many(course_users => 'DB::Schema::Result::CourseUser', 'user_id'); | ||
| __PACKAGE__->many_to_many(courses => 'course_users', 'courses'); | ||
| __PACKAGE__->many_to_many(course => 'course_users', 'course'); |
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.
This changes assessor names in the DBIx::Class relationships for consistency. For singular relationships, the 's' has been dropped.
Note: this is based on #106, which has some changes to the CourseSettings database tables.