Guest User

Untitled

a guest
May 21st, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. Stympy/faker on github has lots of fun "data" for you to run in your program while you are working on them.
  2. Every time you change a gem file you must bundle install in your terminal.
  3.  
  4. When using the post, patch and delete routes - we are not displaying information - when using these, we are going
  5. to redirect.
  6.  
  7. flash hash - flash messages
  8.  
  9. flash[:success] = "Successfully Updated"
  10.  
  11. Associations - going on BEYOND spreedsheet style - 3D style of spreedsheet
  12.  
  13. Whenever you create a model, you also create a migration file. Once you make you the migration file, you can edit it up until
  14. you rake db:migrate
  15.  
  16. t.timestamps - short hand for created and updated at.
  17.  
  18. three things can happen when you migrate
  19. error/success/tumbleweeds(nothing)
  20.  
  21. schema - report of the current stucture of your database - do not change schema
  22.  
  23. If I want to change my database, I must add a new migration.
  24.  
  25. rails g migration AddPriceToProducts (ADD) attribute (changable) (To) table(changable)
  26.  
  27. Postgres does NOT allow floats. It allows decimals - takes a little extra storage, but it is more accurate for $$
  28.  
  29. string
  30. text
  31. integer
  32. float
  33. decimal
  34. boolean
  35. binary (images, movies, raw format)
  36. :primary_key (helps with speed with reading/writing)
  37. date
  38. time
  39. datetime
  40. timestamp
  41.  
  42. when using decimals in databases - precision represents how many digits total,
  43. scale is the number of digits to the right of the decimal
Add Comment
Please, Sign In to add comment