Skip to content

Instantly share code, notes, and snippets.

@VelizarHristov
Created August 1, 2022 10:55
Show Gist options
  • Save VelizarHristov/f2cc40d1bf18b7f5a38a7dcad224d029 to your computer and use it in GitHub Desktop.
Save VelizarHristov/f2cc40d1bf18b7f5a38a7dcad224d029 to your computer and use it in GitHub Desktop.
# Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 5.0 upgrade.
#
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Rails 5.0 release notes for more info on each option.
###
### OLD DEFAULTS ###
###
# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
# Previous versions had false.
# TODO: enable when Ruby 2.4 comes out
ActiveSupport.to_time_preserves_timezone = false
###
### NEW DEFAULTS ###
###
# Enable per-form CSRF tokens. Previous versions had false.
Rails.application.config.action_controller.per_form_csrf_tokens = true
# Enable origin-checking CSRF mitigation. Previous versions had false.
Rails.application.config.action_controller.forgery_protection_origin_check = true
# Require `belongs_to` associations by default. Previous versions had false.
Rails.application.config.active_record.belongs_to_required_by_default = true
Rails.application.config.active_record.time_zone_aware_types = [:datetime, :time]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment