Skip to content

Commit

Permalink
test rails5: update
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Nov 19, 2018
1 parent bc40824 commit ad8e300
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 30 deletions.
14 changes: 7 additions & 7 deletions test/apps/rails5.0/Gemfile.lock
Expand Up @@ -66,7 +66,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
concurrent-ruby (1.1.3)
crass (1.0.4)
erubis (2.7.0)
execjs (2.7.0)
Expand All @@ -87,7 +87,7 @@ GEM
hashie (3.6.0)
i18n (1.1.1)
concurrent-ruby (~> 1.0)
jbuilder (2.7.0)
jbuilder (2.8.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
jquery-rails (4.3.3)
Expand All @@ -104,7 +104,7 @@ GEM
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
method_source (0.9.1)
method_source (0.9.2)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
Expand All @@ -113,7 +113,7 @@ GEM
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
puma (3.12.0)
rack (2.0.5)
rack (2.0.6)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.7)
Expand Down Expand Up @@ -143,7 +143,7 @@ GEM
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
sass (3.6.0)
sass (3.7.2)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand All @@ -166,15 +166,15 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
thor (0.20.0)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.8)
turbolinks (5.2.0)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (4.1.19)
uglifier (4.1.20)
execjs (>= 0.3.0, < 3)
web-console (3.7.0)
actionview (>= 5.0)
Expand Down
5 changes: 0 additions & 5 deletions test/apps/rails5.0/bin/rails
@@ -1,9 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
5 changes: 0 additions & 5 deletions test/apps/rails5.0/bin/rake
@@ -1,9 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require_relative '../config/boot'
require 'rake'
Rake.application.run
5 changes: 4 additions & 1 deletion test/apps/rails5.0/config/environments/development.rb
Expand Up @@ -34,6 +34,9 @@
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log

# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load

# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
Expand All @@ -47,5 +50,5 @@

# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
end
3 changes: 3 additions & 0 deletions test/apps/rails5.0/config/environments/production.rb
Expand Up @@ -80,4 +80,7 @@
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end

# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end
@@ -1,6 +1,8 @@
# Be sure to restart your server when you modify this file.

# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# ActiveSupport::Reloader.to_prepare do
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# end
20 changes: 12 additions & 8 deletions test/apps/rails5.0/config/initializers/new_framework_defaults.rb
Expand Up @@ -2,20 +2,24 @@
#
# This file contains migration options to ease your Rails 5.0 upgrade.
#
# Read the Rails 5.0 release notes for more info on each option.
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Guide for Upgrading Ruby on Rails for more info on each option.

Rails.application.config.action_controller.raise_on_unfiltered_parameters = true

# Enable per-form CSRF tokens. Previous versions had false.
Rails.application.config.action_controller.per_form_csrf_tokens = true
Rails.application.config.action_controller.per_form_csrf_tokens = false

# Enable origin-checking CSRF mitigation. Previous versions had false.
Rails.application.config.action_controller.forgery_protection_origin_check = true
Rails.application.config.action_controller.forgery_protection_origin_check = false

# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
# Previous versions had false.
ActiveSupport.to_time_preserves_timezone = true
ActiveSupport.to_time_preserves_timezone = false

# Do not halt callback chains when a callback returns false. Previous versions had true.
ActiveSupport.halt_callback_chains_on_return_false = false
# Require `belongs_to` associations by default. Previous versions had false.
Rails.application.config.active_record.belongs_to_required_by_default = false

# Configure SSL options to enable HSTS with subdomains. Previous versions had false.
Rails.application.config.ssl_options = { hsts: { subdomains: true } }
# Do not halt callback chains when a callback returns false. Previous versions had true.
ActiveSupport.halt_callback_chains_on_return_false = true
5 changes: 5 additions & 0 deletions test/apps/rails5.0/config/initializers/wrap_parameters.rb
Expand Up @@ -7,3 +7,8 @@
ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json]
end

# To enable root element in JSON for ActiveRecord objects.
# ActiveSupport.on_load(:active_record) do
# self.include_root_in_json = true
# end

0 comments on commit ad8e300

Please sign in to comment.