-
Notifications
You must be signed in to change notification settings - Fork 13
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, Hallie, Samantha, Sabrina #93
base: master
Are you sure you want to change the base?
Conversation
Merchant dashboard
migration to orders
status column added to order items
Merchant dashboard
Merchant dashboard CSS
Products controller test
Removed Test Login
added test for toggle
update product on cart logic
Fixed checkout form
fixed small bug on reviews
prevented user from editing another user's product
prevented guest from updating product
changes not to allow guest user to create category
Becca Elenzil Tue, Nov 5, 2:35 PM (22 hours ago) to me bEtsyWhat We're Looking ForManual testing
Code Review
Overall FeedbackGreat work overall! You've built a fully functional web store from top to bottom. This represents a huge amount of work, and you should be proud of yourselves!. I am particularly impressed by the way that you took a TDD approach and created thorough tests. There are still a few test cases missing, particularly around failure case (though I want to acknowledge that I may have missed a few that you had). bEtsy is a huge project on a very short timeline, and this feedback should not at all diminish the magnitude of what you've accomplished. Keep up the hard work! Only the person who submitted the PR will get an email about this feedback. Please let the rest of your team know about it. |
def create | ||
order = Order.find_by(id: session[:order_id]) | ||
|
||
if session[:order_id].nil? || order.nil? |
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.
order.nil? should be enough here since if session[:order_id] is nil, order will be nil.
return | ||
else | ||
oi.quantity += order_items[:quantity] | ||
oi.save |
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.
There needs to be a check on the .save
|
||
order = Order.find(session[:order_id]) | ||
# if order item already exists in cart, increase quantity. | ||
order.order_items.each do |oi| |
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.
Per Hallie's requested focused feedback, some of this work could be done through a validation something like this:
#order_item.rb
validates :quantity, numericality: { less_than_or_equal_to: product.stock }, message: <THE MESSAGE> (edited)
#order_items_controller
if oi.save
flash[:success] = # ...
else
flash[:failure] = oi.errors.messages.join("; ")
end
return result[:orders_by_status] | ||
end | ||
|
||
def find_order_statuses() |
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.
Per Sabrina's request for focused feedback. These group of methods look good. I wonder if find_order_statuses
could have been broken up into smaller methods to simplify a bit.
bEtsy
Congratulations! You're submitting your assignment! These comprehension questions should be answered by all members of your team, not by a single teammate.
Comprehension Questions
Sabrina: I was responsible for the merchant dashboard and I'm pretty happy with what it allows you to do and the way it looks. I'm proud of the code around filtering an order by merchant so that a merchant only sees the status of their part of the order and can only see and effect order-items that have their products.
Georgina: At first I was responsible for orders and then we realized that orders were very related to order_item so I worked with Hallie to do the logic. I also worked on the reviews and the checkout part.
Sam: I was primarily responsible for the Product Class, including products controller, model validations, tests, products views to show "all products" and "products by category" (working on the category relationship), also created the product "show view" shopping product page, created the seeds for products. Also supported the merchant dashboard features on creating actions to edit and create a product, create and add a category to products, also developed logic to retire/reactivate a product as a merchant and applied general CSS on the project. In general for the common features I worked using pair programming with all other team members which was always an addition to my features.
Sabrina: I guess the methods around finding orders by status in the user model, and the tests. I'm happy I was able to get them to work but I'm not sure it was the best way, and I wonder if maybe our underlying data structure could be changed to make these sorts of operations more efficient.
Georgina: I was primarily responsible for the Order checkout functionality. This meant validating the fields in the Orders model and figuring out how to work with OrderItems and with session to create a cart and then LATER validate user information.
Sam: Product Class.