Feature/preserve data#6
Conversation
…ool-library-oop into feature/refactor-code
…ool-library-oop into feature/preserve-data
…ool-library-oop into feature/preserve-data
…ool-library-oop into feature/preserve-data
There was a problem hiding this comment.
Hi Team,
Great job on saving the JSON files.
There are some issues that you still need to work on to go to the next project but you are almost there!
Required Changes ♻️
Check the comments under the review.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
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.
| if File.exist? file | ||
| JSON.parse(File.read(file)).map do |rental_json| | ||
| book = books.find { |current_book| current_book.title == rental_json['book_title'] } | ||
| person = people.find { |current_person| current_person.id == rental_json['person_id'].to_i } |
There was a problem hiding this comment.
- on first start the application is firing and working as expected when closing the application the JSON files are created as well, however, when restarting the application is not firing and the user gets below error:

the reason the user gets this error is because the information in the JSON files is saved as an array of strings and it can't find the title in the string. in order to make it work this way the data in your JSON file should be saved as an array of objects which will look something like in the below example:
[{"Title": "hp", "Author": "jk"},{"Title": "hp2", "Author": "jk"}]
In the example I'm using the books array but this also applies for the people and rental array.
There was a problem hiding this comment.
now i see the problem now but I fixed it someway else
thanks for the hint
Dipeshtwis
left a comment
There was a problem hiding this comment.
Status: Approved ✔️
Hi Team,
Good job on implementing the suggested changes. Well Done.
Your project is complete! There is nothing else to say other than... it's time to merge it ![]()
Congratulations! 🎉
You may close this Pull Request and merge the changes
Keep being awesome devs and good luck with your next milestone!
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Dipesh Kumar
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.
In this PR, I did the following: