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

Keep Rails Upgraded

Keep Rails Upgraded

Lucky you, it's time to upgrade Rails versions! I know, you just upgraded your app a few years ago, but it's time again. The good news is that you've got a team of "professionals" to help make the process a bit smoother.

We'll start this workshop by working together to upgrade an existing Rails 4 application to Rails 5. We will highlight some common pitfalls and then we'll work as a group to kickstart your own app upgrade.

Why suffer alone? Join us for this Rails upgrading workshop and you'll have a community of support from fellow upgraders, Rails contributors, and Ruby Heroes.

Derek Prior

May 06, 2016
Tweet

More Decks by Derek Prior

Other Decks in Technology

Transcript

  1. KEEP RAILS
    UPGRADED

    View Slide

  2. DEREK PRIOR

    View Slide

  3. RICHARD SCHNEEMAN

    View Slide

  4. CALEB THOMPSON

    View Slide

  5. EVERYONE ELSE

    View Slide

  6. HOMEWORK

    View Slide

  7. github.com/derekprior/lobsters

    View Slide

  8. AGENDA

    View Slide

  9. WORDS OF UPGRADING
    WISDOM

    View Slide

  10. GROUP LIVE CODING

    View Slide

  11. ADDITIONAL RAILS 5
    CONCERNS

    View Slide

  12. UPGRADE YOUR APP WITH
    OUR HELP

    View Slide

  13. WHY?

    View Slide

  14. HOW?

    View Slide

  15. BEFORE YOU
    UPGRADE

    View Slide

  16. CLEAN SUITE

    View Slide

  17. RUBY 2.3

    View Slide

  18. UPDATE YOUR BUNDLE

    View Slide

  19. bundle outdated

    View Slide

  20. bundle update

    View Slide

  21. bundle update scenic

    View Slide

  22. View Slide

  23. READ THE DOCS

    View Slide

  24. READY TO UPGRADE
    > Clean Suite
    > Latest Ruby
    > Updated Bundle
    > Documentation Read

    View Slide

  25. View Slide

  26. View Slide

  27. OTHER
    PROBLEMS

    View Slide

  28. PARAMS IS NOT A HASH

    View Slide

  29. to_h WILL RETURN A HASH

    View Slide

  30. to_unsafe_h WILL GIVE YOU ALL PARAMETERS

    View Slide

  31. CALLBACKS DON'T STOP WITH FALSE

    View Slide

  32. throw :abort TO HALT CALLBACK CHAINS

    View Slide

  33. CONTROLLER TESTING EXTRACTED

    View Slide

  34. ASSIGNS, TEMPLATE TESTING REMOVED

    View Slide

  35. NOW LIVE IN rails-controller-testing GEM

    View Slide

  36. content_tag_for AND div_for EXTRACTED

    View Slide

  37. record_tag_helper GEM

    View Slide

  38. ApplicationRecord

    View Slide

  39. SIMILAR USE-CASE TO ApplicationController

    View Slide

  40. APP-SPECIFIC EXTENSIONS FOR DATABASE-BACKED MODELS

    View Slide

  41. KEEPS FROM MONKEY-PATCHING ActiveRecord::Base

    View Slide