diff --git a/README.md b/README.md index 2fce760..c89ee7c 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186). -_1223 TILs and counting..._ +_1224 TILs and counting..._ --- @@ -749,6 +749,7 @@ _1223 TILs and counting..._ - [Get ActiveRecord Attribute Directly From Database](rails/get-active-record-attribute-directly-from-database.md) - [Get An Array Of Values From The Database](rails/get-an-array-of-values-from-the-database.md) - [Get An Empty ActiveRecord Relation](rails/get-an-empty-activerecord-relation.md) +- [Get Help With A Rails App Update](rails/get-help-with-a-rails-app-update.md) - [Get The Column Names For A Model](rails/get-the-column-names-for-a-model.md) - [Get The Current Time](rails/get-the-current-time.md) - [Grab A Random Record From The Database](rails/grab-a-random-record-from-the-database.md) diff --git a/rails/get-help-with-a-rails-app-update.md b/rails/get-help-with-a-rails-app-update.md new file mode 100644 index 0000000..2c44509 --- /dev/null +++ b/rails/get-help-with-a-rails-app-update.md @@ -0,0 +1,29 @@ +# Get Help With A Rails App Update + +Rails version upgrades can be pretty involved. The ecosystem and the framework +are under constant evolution. While each patch version will stay reliably +stable, as soon as you go to do a minor or major upgrade (which you should stay +on top of), you'll have lots to consider. + +Rails helps with this via the `app:update` rake task. + +When run, it will prompt you with a series of files that it wants to change. +For each one you'll have some options. + +```bash +$ rails app:update + +Overwrite my-app/config/boot.rb? (enter "h" for help) [Ynaqdhm] h + Y - yes, overwrite + n - no, do not overwrite + a - all, overwrite this and all others + q - quit, abort + d - diff, show the differences between the old and the new + h - help, show this help + m - merge, run merge tool +``` + +Start by using `d` to see a diff of the changes. If it's small and doesn't +overwrite important, existing settings, then you can use `y` to accept them. +For a lot of these files the changes will be too aggressive. So side-by-side +with the diff, update the file manually. Then use `n` to go to the next update.