Skip to content

Commit

Permalink
Help Rails find the association models
Browse files Browse the repository at this point in the history
This helps with crashes of database_consistency
  • Loading branch information
hellcp-work committed Feb 28, 2023
1 parent 8b65c57 commit 89feb80
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/api/.database_consistency.todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,16 @@ Role:
title:
MissingUniqueIndexChecker:
enabled: false
attrib_type_modifiable_bies:
ForeignKeyChecker:
enabled: false
ForeignKeyTypeChecker:
enabled: false
relationships:
ForeignKeyChecker:
enabled: false
ForeignKeyTypeChecker:
enabled: false
Review:
id:
PrimaryKeyTypeChecker:
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/models/role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class NotFound < APIError
message: 'is the name of an already existing role' }

belongs_to :groups_roles, optional: true
belongs_to :attrib_type_modifiable_bies, optional: true
belongs_to :relationships, optional: true
belongs_to :attrib_type_modifiable_bies, class_name: 'AttribTypeModifiableBy', optional: true
belongs_to :relationships, class_name: 'Relationship', optional: true
belongs_to :roles_static_permissions, optional: true
belongs_to :roles_users, optional: true

Expand Down

0 comments on commit 89feb80

Please sign in to comment.