-
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
Feature/Setup-associations #3
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.
Hello @NitBravoA92 , 👋
I'm Levy, your PR reviewer
Good job so far 👍
There are some issues that you still need to work on to go to the next project but you are almost there!
Highlights
- No linter error ✔️
Status: REQUIRED CHANGES ♻️
Check the comments under the review.
Optional suggestions
Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me @levy002 in your question so I can receive the notification.
Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
classes/book.rb
Outdated
attr_accessor :title, :author | ||
attr_reader :rentals |
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'd recommend considering the use of both read and write access for the
rentals
attribute. By using theattr_accessor
declaration instead of justattr_reader
, you enable the class to not only allow the retrieval of rental information but also facilitate the addition and removal of rentals. This added flexibility can be valuable when managing rental history and making updates to rental records. This change will make your code more versatile and adaptable to various library management scenarios."
classes/classroom.rb
Outdated
def enter_student(student) | ||
@students.push(student) | ||
student.classroom = self # make this student part of this classroom | ||
end |
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.
- When implementing the
enter_student
method, it's a good practice to ensure that the student is not already included in the classroom before adding them. You can achieve this by using a conditional statement. Before adding the student, check if the@students
array already includes the student. If not, then proceed to add the student to the classroom and set theirclassroom
attribute to the current classroom instance. This approach helps to avoid duplicate entries and ensures that each student is added to the classroom only once.
def enter_student(student) | |
@students.push(student) | |
student.classroom = self # make this student part of this classroom | |
end | |
def enter_student(student) | |
@students.push(student) unless students.includes(self)? | |
student.classroom = self # make this student part of this classroom | |
end |
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.
Approved 🙌
Hi @NitBravoA92
Good job implementing the suggested changes💪 Your project is COMPLETE! There is nothing else to say other than... it's time to merge it! 🚀 Congratulations!
Highlights 🎯
There are some excellent points that you have made perfectly. Keep up the great work! 👏
- ✅ Associations are correctly created
- ✅ Great work using the right GitFlow
- ✅ Your README looks good
- ✅ Linters are working properly
Optional suggestions ❕
N/A
Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.
Cheers and Happy coding!👏👨💻💻
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.
Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
🚩Milestone 3: set up associations | setup-associations - >>branch<< -
Hi there! @NitBravoA92 here. 👋
This is the PR for the OOP school library: set up associations activity. The main goal of this Milestone is: create the remaining classes for the school library (Classroom, Book, Rental) and implement the associations relationship between classes.
Here is a summary of what has been done:
Create the
Classroom
class with two variables: @Label and @Students, and the methodenter_student
Add the relationship between
Student
andClassroom
Create the
Book
class with two variables: @title and @author, and the methodnew_rental
Add the variable @rentals and the method
new_rental
in thePerson
classCreate the
Rental
class with three variables: @Date, @book and @personAdd the association relationships to the respective classes.
Update the run.rb file, with test code to demonstrate the functioning of the previously created classes
Update the README.md file
⭐To the code reviewer 👨💻
💝 I really thank 🙇♂️ you, dear code reviewer 👨🎨 for dedicating your precious 🥇 time ⌚ to check the PR 🧾 .
I kindly ask 🙏 dear code reviewer 🤵 that if there is any kind of issue 🦯 in this project, please do list 📃 them in a descriptive 💡 manner and give your best suggestions 🎁 if needed.
If you think some big issues are essential to be changed ♻️ please kindly contact 📞 me through Zoom or Slack, I am available on Microverse UTC-6 time zone.