Dopamine Tracker App Plan

#ruby #rails #models #sessions #users

Dopa-Mine App

Find Ways To Integrate:

Steps.0

  1. Determine Models
  2. Build Schema/DB (remember joint tables)
  3. Validate associations
  4. Create Sessions
  5. Write tests

To-Do Organized by Pages:

1. Home/Login

2. User Dashboard @ users#home

3.

TO DO: map all the routes > models > views

Models

User has_and_belongs_to_many :activities has_many :comments

rails generate model User username:string email:string password_digest:string

Followed by rails db:migrate

Activity has_and_belongs_to_many :users has_many :dopamine_points has_many :comments

DopaminePoints belongs_to :activity belongs_to :user

Comment belongs_to :commented_on, polymorphic: true belongs_to :user

Rolling back migrations:

Object syntax notes

@user object is initialized by User.new class + method

In console: Activity.find(1)