Upgrade to Pro — share decks privately, control downloads, hide ads and more …

rails study group day 6

Avatar for mrkhutter mrkhutter
February 29, 2016
37

rails study group day 6

interacting with our models

Avatar for mrkhutter

mrkhutter

February 29, 2016

Transcript

  1. Pull Request • make code changes in feature branch •

    git checkout -b feature/my_feature_branch • commit your code • use github to make a pull request
  2. Git Flow • to start: always git pull origin <branch>

    • git checkout -b feature/my_feature_branch • write the code! • commit your code • git add path/to/files • git commit -m “your commit message” • git push • use github.com to make a pull request
  3. MVC

  4. MVC

  5. MVC

  6. MVC

  7. MVC

  8. MVC

  9. Index • Do you want to find a model by

    attribute? • Prevents “full table scan” • To add index • rails g migration AddIndexToTableColumn
  10. Update • updates update_at timestamp • direct update with resave

    • update_attribute(:attribute, value) • update_attributes(attribute1: value, attribute2:value)
  11. Tests • Especially important for teams without QA • Ruby

    is dynamically typed - make sure you get what you are expecting • Provides a developer confidence in their code