-
Notifications
You must be signed in to change notification settings - Fork 0
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
HER-50 Create Organization Model #40
Conversation
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 made some suggestions to the code. Can you let me know what you think, please?
Co-authored-by: Olesia <[email protected]>
Co-authored-by: Olesia <[email protected]>
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.
Looks good.
I have only one question about the new schema: should the Donations table have sripe related columns or not?
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.
Looks good to me!
It should not, Raquel removed them when she did her PR, I guess because she knows we are not going to get to that part of the wishlist. I will check and see if I still have them. |
HER-50: Create Organization Model
Issue
https://raquelanaroman.atlassian.net/browse/HER-50
Description
As a user, I want to associate users/be associated with an organization so that the system can clearly represent relationships between individuals and the entities they belong to.
Each organization should be allowed to have multiple users and an address. Organizations should have a name and type, with support for different organization types. The address for each organization will use the existing polymorphic association in the Address model.
Acceptance Criteria
Create an Organization model with the following attributes: name: string, required, org_type: integer, default: 0, null: false.
Associate organization with:
Users: An organization should have many users.
Address: Use the polymorphic Address association, where addressable_type is Organization.
Validate the presence of name and org_type.
Add a test to ensure the polymorphic Address relationship works with Organization.
Implementation
Generate the Organization Model:
Add Associations to the Organization Model
Update the User Model
Ensure the User model has belongs_to :organization, optional: true
Write tests to verify that it functions properly.
https://raquelanaroman.atlassian.net/browse/HER-4
Changes
Review Checklist