Skip to content

Commit 2beb7ad

Browse files
committed
apply changes from railsdiff
* update rails framework files * details see: http://railsdiff.org/6.0.3/6.1.0
1 parent b37e3c1 commit 2beb7ad

20 files changed

+117
-55
lines changed

.gitattributes

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# See https://git-scm.com/docs/gitattributes for more about git attribute files.
2+
3+
# Mark the database schema as having been generated.
4+
db/schema.rb linguist-generated
5+
6+
# Mark the yarn lockfile as having been generated.
7+
yarn.lock linguist-generated
8+
9+
# Mark any vendored files as having been vendored.
10+
vendor/* linguist-vendored

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
# Ignore the default SQLite database.
1111
/db/*.sqlite3*
12-
/db/*.sqlite3-journal
1312
/db/*.sqlite3-*
1413

1514
# Ignore all logfiles and tempfiles.

Gemfile

+7-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ gem 'puma', '~> 5.1'
1212
# Use SCSS for stylesheets
1313
gem 'sass-rails', '>= 6'
1414
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
15-
# gem 'webpacker', '~> 4.0'
15+
# gem 'webpacker', '~> 5.0'
1616
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
1717
gem 'turbolinks', '~> 5'
1818
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
@@ -26,7 +26,7 @@ gem 'jbuilder', '~> 2.10'
2626
# gem 'image_processing', '~> 1.2'
2727

2828
# Reduces boot times through caching; required in config/boot.rb
29-
gem 'bootsnap', '>= 1.4.2', require: false
29+
gem 'bootsnap', '>= 1.4.4', require: false
3030

3131
group :development, :test do
3232
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
@@ -35,16 +35,18 @@ end
3535

3636
group :development do
3737
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
38-
gem 'web-console', '>= 3.3.0'
38+
gem 'web-console', '>= 4.1.0'
39+
# Display performance information such as SQL time and flame graphs for each request in your browser.
40+
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
41+
gem 'rack-mini-profiler', '~> 2.0'
3942
gem 'listen', '~> 3.3'
4043
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
4144
gem 'spring'
42-
gem 'spring-watcher-listen', '~> 2.0.0'
4345
end
4446

4547
group :test do
4648
# Adds support for Capybara system testing and selenium driver
47-
gem 'capybara', '>= 2.15'
49+
gem 'capybara', '>= 3.26'
4850
gem 'selenium-webdriver'
4951
# Easy installation and use of web drivers to run system tests with browsers
5052
gem 'webdrivers'

Gemfile.lock

+7-8
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ GEM
132132
puma (5.1.0)
133133
nio4r (~> 2.0)
134134
rack (2.2.3)
135+
rack-mini-profiler (2.3.0)
136+
rack (>= 1.2.0)
135137
rack-test (1.1.0)
136138
rack (>= 1.0, < 3)
137139
rails (6.1.0)
@@ -188,9 +190,6 @@ GEM
188190
actionpack (>= 5.0)
189191
activemodel (>= 5.0)
190192
spring (2.1.1)
191-
spring-watcher-listen (2.0.1)
192-
listen (>= 2.7, < 4.0)
193-
spring (>= 1.2, < 3.0)
194193
sprockets (4.0.2)
195194
concurrent-ruby (~> 1.0)
196195
rack (> 1, < 3)
@@ -229,10 +228,10 @@ PLATFORMS
229228
ruby
230229

231230
DEPENDENCIES
232-
bootsnap (>= 1.4.2)
231+
bootsnap (>= 1.4.4)
233232
bootstrap (~> 4.5.3)
234233
byebug
235-
capybara (>= 2.15)
234+
capybara (>= 3.26)
236235
diffy
237236
equivalent-xml
238237
inline_svg (~> 1.7)
@@ -243,23 +242,23 @@ DEPENDENCIES
243242
listen (~> 3.3)
244243
pg
245244
puma (~> 5.1)
245+
rack-mini-profiler (~> 2.0)
246246
rails (~> 6.1.0)
247247
rails-i18n (~> 6.0)
248248
rouge (~> 3.26)
249249
sass-rails (>= 6)
250250
selenium-webdriver
251251
simple_form (~> 5.0)
252252
spring
253-
spring-watcher-listen (~> 2.0.0)
254253
sqlite3 (~> 1.4)
255254
turbolinks (~> 5)
256255
tzinfo-data
257256
validates_timeliness (~> 4.1)
258-
web-console (>= 3.3.0)
257+
web-console (>= 4.1.0)
259258
webdrivers
260259

261260
RUBY VERSION
262261
ruby 2.6.5p114
263262

264263
BUNDLED WITH
265-
1.17.2
264+
1.17.3

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add your own tasks in files placed in lib/tasks ending in .rake,
22
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
33

4-
require_relative 'config/application'
4+
require_relative "config/application"
55

66
Rails.application.load_tasks

app/javascript/channels/consumer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Action Cable provides the framework to deal with WebSockets in Rails.
2-
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
2+
// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command.
33

44
import { createConsumer } from "@rails/actioncable"
55

app/javascript/packs/application.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33
// a relevant structure within app/javascript and only use these pack files to reference
44
// that code so it'll be compiled.
55

6-
require("@rails/ujs").start()
7-
require("turbolinks").start()
8-
require("@rails/activestorage").start()
9-
require("channels")
6+
import Rails from "@rails/ujs"
7+
import Turbolinks from "turbolinks"
8+
import * as ActiveStorage from "@rails/activestorage"
9+
import "channels"
1010

11-
12-
// Uncomment to copy all static images under ../images to the output folder and reference
13-
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
14-
// or the `imagePath` JavaScript helper below.
15-
//
16-
// const images = require.context('../images', true)
17-
// const imagePath = (name) => images(name, true)
11+
Rails.start()
12+
Turbolinks.start()
13+
ActiveStorage.start()

config.ru

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This file is used by Rack-based servers to start the application.
22

3-
require_relative 'config/environment'
3+
require_relative "config/environment"
44

55
run Rails.application
6+
Rails.application.load_server

config/application.rb

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
require_relative 'boot'
1+
require_relative "boot"
22

3-
require 'rails/all'
3+
require "rails/all"
44

55
# Require the gems listed in Gemfile, including any gems
66
# you've limited to :test, :development, or :production.
@@ -9,11 +9,14 @@
99
module SimpleFormBootstrap
1010
class Application < Rails::Application
1111
# Initialize configuration defaults for originally generated Rails version.
12-
config.load_defaults 6.0
12+
config.load_defaults 6.1
1313

14-
# Settings in config/environments/* take precedence over those specified here.
15-
# Application configuration can go into files in config/initializers
16-
# -- all .rb files in that directory are automatically loaded after loading
17-
# the framework and any gems in your application.
14+
# Configuration for the application, engines, and railties goes here.
15+
#
16+
# These settings can be overridden in specific environments using the files
17+
# in config/environments, which are processed later.
18+
#
19+
# config.time_zone = "Central Time (US & Canada)"
20+
# config.eager_load_paths << Rails.root.join("extras"
1821
end
1922
end

config/boot.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
22

3-
require 'bundler/setup' # Set up gems listed in the Gemfile.
4-
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
3+
require "bundler/setup" # Set up gems listed in the Gemfile.
4+
require "bootsnap/setup" # Speed up boot time by caching expensive operations.

config/environment.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Load the Rails application.
2-
require_relative 'application'
2+
require_relative "application"
33

44
# Initialize the Rails application.
55
Rails.application.initialize!

config/environments/development.rb

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
require "active_support/core_ext/integer/time"
2+
13
Rails.application.configure do
24
# Settings specified here will take precedence over those in config/application.rb.
35

4-
# In the development environment your application's code is reloaded on
5-
# every request. This slows down response time but is perfect for development
6+
# In the development environment your application's code is reloaded any time
7+
# it changes. This slows down response time but is perfect for development
68
# since you don't have to restart the web server when you make code changes.
79
config.cache_classes = false
810

@@ -39,6 +41,12 @@
3941
# Print deprecation notices to the Rails logger.
4042
config.active_support.deprecation = :log
4143

44+
# Raise exceptions for disallowed deprecations.
45+
config.active_support.disallowed_deprecation = :raise
46+
47+
# Tell Active Support which deprecation messages to disallow.
48+
config.active_support.disallowed_deprecation_warnings = []
49+
4250
# Raise an error on page load if there are pending migrations.
4351
config.active_record.migration_error = :page_load
4452

@@ -54,9 +62,15 @@
5462
config.assets.quiet = true
5563

5664
# Raises error for missing translations.
57-
# config.action_view.raise_on_missing_translations = true
65+
# config.i18n.raise_on_missing_translations = true
66+
67+
# Annotate rendered view with file names.
68+
# config.action_view.annotate_rendered_view_with_filenames = true
5869

5970
# Use an evented file watcher to asynchronously detect changes in source code,
6071
# routes, locales, etc. This feature depends on the listen gem.
6172
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
73+
74+
# Uncomment if you wish to allow Action Cable access from any origin.
75+
# config.action_cable.disable_request_forgery_protection = true
6276
end

config/environments/production.rb

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require "active_support/core_ext/integer/time"
2+
13
Rails.application.configure do
24
# Settings specified here will take precedence over those in config/application.rb.
35

@@ -29,7 +31,7 @@
2931
config.assets.compile = false
3032

3133
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
32-
# config.action_controller.asset_host = 'http://assets.example.com'
34+
# config.asset_host = 'http://assets.example.com'
3335

3436
# Specifies the header that your server uses for sending files.
3537
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
@@ -46,9 +48,9 @@
4648
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
4749
# config.force_ssl = true
4850

49-
# Use the lowest log level to ensure availability of diagnostic information
50-
# when problems arise.
51-
config.log_level = :debug
51+
# Include generic and useful information about system operation, but avoid logging too much
52+
# information to avoid inadvertent exposure of personally identifiable information (PII).
53+
config.log_level = :info
5254

5355
# Prepend all log lines with the following tags.
5456
config.log_tags = [ :request_id ]
@@ -73,11 +75,17 @@
7375
# Send deprecation notices to registered listeners.
7476
config.active_support.deprecation = :notify
7577

78+
# Log disallowed deprecations.
79+
config.active_support.disallowed_deprecation = :log
80+
81+
# Tell Active Support which deprecation messages to disallow.
82+
config.active_support.disallowed_deprecation_warnings = []
83+
7684
# Use default logging formatter so that PID and timestamp are not suppressed.
7785
config.log_formatter = ::Logger::Formatter.new
7886

7987
# Use a different logger for distributed setups.
80-
# require 'syslog/logger'
88+
# require "syslog/logger"
8189
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
8290

8391
if ENV["RAILS_LOG_TO_STDOUT"].present?

config/environments/test.rb

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require "active_support/core_ext/integer/time"
2+
13
# The test environment is used exclusively to run your application's
24
# test suite. You never need to work with it otherwise. Remember that
35
# your test database is "scratch space" for the test suite and is wiped
@@ -43,6 +45,15 @@
4345
# Print deprecation notices to the stderr.
4446
config.active_support.deprecation = :stderr
4547

48+
# Raise exceptions for disallowed deprecations.
49+
config.active_support.disallowed_deprecation = :raise
50+
51+
# Tell Active Support which deprecation messages to disallow.
52+
config.active_support.disallowed_deprecation_warnings = []
53+
4654
# Raises error for missing translations.
47-
# config.action_view.raise_on_missing_translations = true
55+
# config.i18n.raise_on_missing_translations = true
56+
57+
# Annotate rendered view with file names.
58+
# config.action_view.annotate_rendered_view_with_filenames = true
4859
end
+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Be sure to restart your server when you modify this file.
22

33
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4-
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
4+
# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
55

6-
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7-
# Rails.backtrace_cleaner.remove_silencers!
6+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
7+
# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
8+
Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Be sure to restart your server when you modify this file.
22

33
# Configure sensitive parameters which will be filtered from the log file.
4-
Rails.application.config.filter_parameters += [:password]
4+
Rails.application.config.filter_parameters += [
5+
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
6+
]
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Define an application-wide HTTP permissions policy. For further
2+
# information see https://developers.google.com/web/updates/2018/06/feature-policy
3+
#
4+
# Rails.application.config.permissions_policy do |f|
5+
# f.camera :none
6+
# f.gyroscope :none
7+
# f.microphone :none
8+
# f.usb :none
9+
# f.fullscreen :self
10+
# f.payment :self, "https://secure.example.com"
11+
# end

config/puma.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
99
threads min_threads_count, max_threads_count
1010

11+
# Specifies the `worker_timeout` threshold that Puma will use to wait before
12+
# terminating a worker in development environments.
13+
#
14+
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
15+
1116
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
1217
#
13-
port ENV.fetch("PORT") { 3000 }
18+
port ENV.fetch("PORT") { 3000 }
1419

1520
# Specifies the `environment` that Puma will run in.
1621
#

db/seeds.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file should contain all the record creation needed to seed the database with its default values.
2-
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
2+
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
33
#
44
# Examples:
55
#

test/test_helper.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ENV['RAILS_ENV'] ||= 'test'
2-
require_relative '../config/environment'
3-
require 'rails/test_help'
2+
require_relative "../config/environment"
3+
require "rails/test_help"
44

55
require 'minitest/autorun'
66

0 commit comments

Comments
 (0)