-
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
Leaves - Georgina #27
base: master
Are you sure you want to change the base?
Conversation
I realized that I didn't do the tests for the wave 2. I added the tests. |
Grocery StoreWhat We're Looking For
|
|
||
def self.all(file_name = 'data/customers.csv') | ||
customers = [] | ||
clients = CSV.read(file_name, headers: true).map(&:to_h) |
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.
It's worth thinking about how you would solve this problem if you couldn't edit the csv to have headers.
attr_accessor :products, :customer, :fulfillment_status | ||
|
||
def initialize(id, products, customer, fulfillment_status = :pending) | ||
puts 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.
You need to take out puts statements before you submit! This is debugging code.
@@ -0,0 +1,62 @@ | |||
class Order | |||
attr_reader :id | |||
attr_accessor :products, :customer, :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.
do all of these need to be accessors?
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?Customer
was like planet and order was like solar system.Order
has a one-to-many relation with customer.Order
andCustomer
tracked in the CSV file? How is it tracked in your program? Why might these be different?Oder
we used Customer.find to get the customer information and create a new order.