-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add collaborators #264
Add collaborators #264
Conversation
c180f09
to
73816ce
Compare
73816ce
to
6642fe0
Compare
|
||
@required_fields ~w(collaborator_id department_id)a | ||
|
||
schema "collaborator_departments" do |
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.
Should we not have a role to identify this relation, e.g.: 'President', 'Vice-President', etc?
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.
I thought about creating another schema "board_users" where i give those roles to an user
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.
Inside this schema i can create role field
and give it to user , what you think?
We need to discuss this carefully before going forward |
Co-authored-by: Rui Lopes <76881129+RuiL1904@users.noreply.github.com>
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.
As collaborators change every year you should add the year as a field IMO
create table(:collaborator_departments, primary_key: false) do | ||
add :id, :binary_id, primary_key: true | ||
|
||
add :collaborator_id, references(:users, on_delete: :nothing, type: :binary_id) |
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.
add :collaborator_id, references(:users, on_delete: :nothing, type: :binary_id) | |
add :user_id, references(:users, on_delete: :nothing, type: :binary_id) |
@required_fields ~w(collaborator_id department_id)a | ||
|
||
schema "collaborator_departments" do | ||
belongs_to :collaborator, User |
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.
belongs_to :collaborator, User | |
belongs_to :user, User |
This was closed because it was done in #291 |
No description provided.