-
Notifications
You must be signed in to change notification settings - Fork 50
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
Branches - Angele #34
base: master
Are you sure you want to change the base?
Conversation
…uote marks added to the file
… uncommented self.save in order.rb
@@ -7,7 +7,7 @@ | |||
|
|||
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new | |||
|
|||
describe "Order Wave 1" do | |||
xdescribe "Order Wave 1" 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.
You shouldn't ignore tests once they pass, since part of their value is in catching if you introduce a new bug.
|
||
def self.find(id) | ||
customer_data = self.all | ||
return customer_data.find { |customer| customer.id == 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.
Great use of find
! 🎉
@fulfillment_status = fulfillment_status | ||
|
||
valid_statuses = [:pending, :paid, :processing, :shipped, :complete] | ||
if !valid_statuses.include? @fulfillment_status |
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.
For checks like this you can use unless CONDITION
instead of if !CONDITION
which reads a little clearer since it's easy to overlook the !
if !valid_statuses.include? @fulfillment_status | |
unless valid_statuses.include? @fulfillment_status |
Well done! Your code was clear and concise. One thing that I wanted to make sure to point out again is that some of your tests were ignored when you checked in your code. This wasn't a big deal here because all of them still passed but it's important to run all of your tests before you check code in so that you can be sure you didn't break something. Overall though this was a really strong submission. Again, well done! |
Grocery Store
Congratulations! You're submitting your assignment.
Comprehension Questions
raise ArgumentError
?.all
&.find
methods class methods? Why not instance methods?Order
andCustomer
. Is this relation one-to-one, one-to-many, or something else? How does that compare to the Solar System project?Order
andCustomer
tracked in the CSV file? How is it tracked in your program? Why might these be different?