Hakeemmidan / Jewely

An Etsy Inspired mock-marketplace that specializes in Jewelry
MIT License
1 stars 1 forks source link

Product Seller Username Fetching Method #2

Closed Hakeemmidan closed 4 years ago

Hakeemmidan commented 4 years ago

The product seller username tends to not instantly appear on screen in ProductShow. It takes some time to get fetched. This results in a 'wonky' looking product show page.

It may be better to attach the seller username to each product in backend (rather than fetching user for each product in frontend).

This could be achieved in same way that we attached author_username to each review. That is:

  1. Create column for seller_username
  2. Allow it in both model and controller through validations and params (respectively)
  3. Attach seller_username to each product through create action in controller
  4. Extract it using JSON JBuilder
  5. Show it in frontend