Skip to content
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

Carets Power Pup - Christiane, Kayla, Shaunna, Victoria #69

Open
wants to merge 479 commits into
base: master
Choose a base branch
from

Conversation

vsawchuk
Copy link

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

Question Answer
How did your team break up the work to be done? We created trello cards, and split tasks between pairing and individual. They were assigned based on interest/priority.
How did your team utilize git to collaborate? We required code reviews before merging to master, created branches for each new feature, utilized code reviews for comments and change requests.
What did your group do to try to keep your code DRY while many people collaborated on it? Created helpers, partials, controller filters.
What was a technical challenge that you faced as a group? Merge conflicts, especially in html files.
What was a team/personal challenge that you faced as a group? Styling - we'd left the majority of it until the end, and had to pull together to get it done.
What could your team have done better? Not left styling to the end, refactoring (was on a backlog card, but didn't get to it).
What was your application's ERD? (include a link) We created one on paper, so we don't have a link.
What is your Trello URL? https://trello.com/b/Wgvg9Is2/betsy-project-management
What is the Heroku URL of your deployed application? https://treebae.herokuapp.com/

vsawchuk and others added 30 commits October 24, 2017 09:03
…lment and order views to allow marking an order as shipped
fulfillment link added to nav when signed in
minor changes to picture for show page
@revenue_by_status[a_status] = orderitems.sum {|orderitem| orderitem.order.status == a_status ? (orderitem.quantity * orderitem.product.price) : 0}
end
@title = "Fulfillment"
else
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if/else case is redundant with your other controller filters; it will never hit this "else" block because it already checks if you're the right merchant logged in with find_merchant and account_owner?

end

def update_quantity
if @order_item
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this controller, you check for the truthiness of @order_item a couple of times, and if @order_item is not truthy, it shows a specific (but repeated) error message and redirection. You can handle this in the controller filter find_orderitem that you made and reduce duplicate logic.

Same goes for a couple of the other instance variables in this controller where it makes sense

@@ -0,0 +1,144 @@
class ProductsController < ApplicationController
before_action :find_product, only: [:show, :edit, :update, :retire]
before_action :find_merchant, except: [:index, :destroy]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't assign @merchant on the index method, so the check on line 8 would never happen anyway and @merchant will always be not truthy. :) Also, you don't have a destroy action in this controller?

@tildeee
Copy link

tildeee commented Nov 2, 2017

bEtsy

What We're Looking For

Feature Feedback
Baseline
Appropriate Git Usage with all members contributing 🌲
Answered comprehension questions 🌲
Trello board is created and utilized in project management 🌲
Heroku instance is online 🌲
General
Nested routes follow RESTful conventions 🌲
oAuth used for User authentication 🌲
Functionality restricted based on user roles 🌲
Products can be added and removed from cart 🌲
Users can view past orders 🌲
Merchants can add, edit and view their products 🌲
Errors are reported to the user 🌲
Order Functionality
Reduces products' inventory 🌲
Cannot order products that are out of stock 🌲
Changes order state 🌲
Clears current cart 🌲
Database
ERD includes all necessary tables and relationships Going to reach out about receiving an ERD
Table relationships 🌲
Models
Validation rules for Models 🌲
Business logic is in the models 🌲
Controllers
Controller Filters used to DRY up controller code 🌲 , controllers didn't necessarily rely on filters so there's some duplicate checking, adding comments
Testing
Model Testing 🌲 ✨
Controller Testing 🌲 ✨
Session Testing 🌲
SimpleCov at 90% for controller and model tests 94.42% ✨
Front-end
The app is styled to create an attractive user interface 🌲
The app layout uses Foundation's Grid 🌲
Content is organized with HTML5 semantic tags 🌲
CSS is DRY 🌲
Overall 🌲

IMPORTANT: Whoever submitted the PR (and thus will get the notification about this feedback) should share this with their teammates.

Overall, the app is great and functional and pretty bug-free! Here are just a few notes about the project to make it EVEN BETTER. (I have comments on the code when it applies)

  • Some notes about refactoring validations on models to one line on a single particular field
  • You can't remove a category from a product once it's saved on it
  • Authorization on the order_confirmation_path would be dooope

Pretty nifty stuff with the regex you found for validation and the us_state helper you made

Great job on the testing! It's thorough (with the exception of the skipped tests ;) ) but overall I'm really happy with it

validates :rating, presence: true
validates :rating, numericality: { only_integer: true }
validates :rating, numericality: { greater_than_or_equal_to: 1 }
validates :rating, numericality: { less_than_or_equal_to: 5 }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can collapse this to one line:

validates :rating, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: 5 }

The only way this matters is because otherwise you get multiple entries on flash that talk about the errors on numericality on review. I've attached screenshots of before the suggestion and after the suggestion
screen shot 2017-11-02 at 1 57 13 pm
screen shot 2017-11-02 at 1 57 50 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants