Home - Mirv/pet_shop GitHub Wiki

Welcome to the pet_shop wiki!

Pre - Steps

  • Gemfile setup
  • .env file setup user/pass
  • Postgres setup, user/pass env vars in database.yaml
  • .gitignore echo .gitignore >> .env
  • install simple_form config with generator
  • rails db:migrate

App creation

  • rails g scaffold PetCategories name:string description:text
    • rails g scaffold LocationTypes name:string description:text
    • add column to location table, to reference belongs_to
    • add belongs_to to model of location
  • rails g scaffold Location name:string xcoordinate:float ycoordinate:float
  • rails g scaffold Pets name:string description:text pet_categories:references location:references
  • `rails g scaffold User name:string
  • haml converter
  • remove delete actions from pets/pet_categories/locations controllers
  • tweak default route to pets

Security / Identity

  • install devise in gem file
  • rails generate devise:install
  • config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
  • rails generate devise User
  • install pundit in gem file
  • run pundit generator
  • setup up private method for admin/mod/record owner
  • apply must be current user to new method
  • add column for user_id to pet for ownership
  • we are not allowing categories to be remove
  • apply adminModRecord to new & create or just create?
  • scope for showing only visible & available pets
  • page page/view for history of all unvailable versus sold pets
  • default landing page set to avoid looping errors when rebroadcasting error after rescue

Layout

  • menu layout
  • include in views/layout/application
  • remove delete options from pets, pet locations, pet types
  • add site wide title to pages
  • bootstrap theme?

Users

  • User is the in devise login stuff.
    • Later, buyer is self referencing table which owns an order
      • Cart is one to one with Buyer/User?