AgileVentures / MetPlus_tracker

Git Repository for the Waffle issue in MetPlus project
2 stars 4 forks source link

Upgrade to Rails 5 #724

Open mattwr18 opened 5 years ago

mattwr18 commented 5 years ago

As suggested, we should upgrade from 4.2 to 5.0 and then worry about upgrading to 5.1 and/or 5.2

mattwr18 commented 5 years ago

Using this site, https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html, I started going through the differences between rails 4 and 5.

5.1) MetPlus already uses Ruby 2.2.2+ 5.2) Active Record Models Now Inherit from ApplicationRecord by Default so I've followed the instruction there. 5.3) Halting Callback Chains via throw(:abort) , have added this, but not sure we need it with this project or not. ActiveSupport.halt_callback_chains_on_return_false = false 5.4) ActiveJob Now Inherits from ApplicationJob by Default, so I've followed the instruction there. 5.5) Rails Controller Testing 5.5.1) Extraction of some helper methods to rails-controller-testing, added this gem to continue using assert in unit testing. 5.5.2) New behavior when uploading files, does not affect this project. 5.6) Autoloading is Disabled After Booting in the Production Environment, this is followed by this assertion "For the vast majority of applications this change needs no action", but might need further clarification on whether we would need or not. 5.7) XML Serialization, also does not affect this project. 5.8) Removed Support for Legacy mysql Database Adapter, does not affect this project. 5.9) Removed Support for Debugger, does not affect this project. 5.10) Use rails for running tasks and tests, interesting but no changes need to be made, note that there is no need to run bin/rails "As the rails command already looks for and runs bin/rails" 5.11) ActionController::Parameters No Longer Inherits from HashWithIndifferentAccess, not sure, but don't think this affects this project...? 5.12) protect_from_forgery Now Defaults to prepend: false, need more clarification to know if this affects this project or not. 5.13) Default Template Handler is Now RAW, this doesn't affect us, I believe, as the views are .haml files 5.14) Added Wildcard Matching for Template Dependencies, does not affect this project. 5.15) ActionView::Helpers::RecordTagHelper moved to external gem (record_tag_helper), project already using content_tag so no change needed. 5.16) Removed Support for protected_attributes Gem, does not affect this project. 5.17) Removed support for activerecord-deprecated_finders gem, does not affect this project. 5.18) ActiveSupport::TestCase Default Test Order is Now Random, interesting but shouldn't affect us. 5.19) ActionController::Live became a Concern, does not affect this project. 5.20) New Framework Defaults 5.20.1) Active Record belongs_to Required by Default Option, not sure if this affects our site, need a better knowledge of the codebase to say. 5.20.2) Per-form CSRF Tokens, not sure if this affects us. 5.20.3) Forgery Protection with Origin Check, also not sure. 5.20.4) Allow Configuration of Action Mailer Queue Name, affects us? 5.20.5) Support Fragment Caching in Action Mailer Views, affects us? 5.20.6) Configure the Output of db:structure:dump, does not affect this project. 5.20.7) Configure SSL Options to Enable HSTS with Subdomains, don't think we use subdomains. 5.20.8) Preserve Timezone of the Receiver, does not affect this project. 5.21) Changes with JSON/JSONB serialization, not sure if this affects us or not?