Skip to content

Commit 7f2531d

Browse files
committed
Run rails app:update
1 parent 066b1c4 commit 7f2531d

File tree

13 files changed

+286
-58
lines changed

13 files changed

+286
-58
lines changed

bin/setup

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env ruby
22
require "fileutils"
33

4-
# path to your application root.
54
APP_ROOT = File.expand_path("..", __dir__)
5+
APP_NAME = "rails-contributors"
66

77
def system!(*args)
88
system(*args, exception: true)
@@ -30,4 +30,8 @@ FileUtils.chdir APP_ROOT do
3030

3131
puts "\n== Restarting application server =="
3232
system! "bin/rails restart"
33+
34+
# puts "\n== Configuring puma-dev =="
35+
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
36+
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
3337
end

config/application.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
require "action_view/railtie"
1414
# require "action_cable/engine"
1515
require "rails/test_unit/railtie"
16+
1617
# Require the gems listed in Gemfile, including any gems
1718
# you've limited to :test, :development, or :production.
1819
Bundler.require(*Rails.groups)
@@ -24,13 +25,12 @@ class Application < Rails::Application
2425
# Initialize configuration defaults for originally generated Rails version.
2526
config.load_defaults 7.1
2627

27-
config.add_autoload_paths_to_load_path = false
2828
config.middleware.insert 0, BotKiller
2929

3030
# Please, add to the `ignore` list any other `lib` subdirectories that do
3131
# not contain `.rb` files, or that should not be reloaded or eager loaded.
3232
# Common ones are `templates`, `generators`, or `middleware`, for example.
33-
# config.autoload_lib(ignore: %w(assets tasks))
33+
# config.autoload_lib(ignore: %w[assets tasks])
3434

3535
# Configuration for the application, engines, and railties goes here.
3636
#

config/environments/development.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Show full error reports.
1515
config.consider_all_requests_local = true
1616

17-
# Enable server timing
17+
# Enable server timing.
1818
config.server_timing = true
1919

2020
# Enable/disable caching. By default caching is disabled.
@@ -24,9 +24,7 @@
2424
config.action_controller.enable_fragment_cache_logging = true
2525

2626
config.cache_store = :memory_store
27-
config.public_file_server.headers = {
28-
"Cache-Control" => "public, max-age=#{2.days.to_i}"
29-
}
27+
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
3028
else
3129
config.action_controller.perform_caching = false
3230

@@ -60,8 +58,8 @@
6058
# config.i18n.raise_on_missing_translations = true
6159

6260
# Annotate rendered view with file names.
63-
# config.action_view.annotate_rendered_view_with_filenames = true
61+
config.action_view.annotate_rendered_view_with_filenames = true
6462

65-
# Raise error when a before_action's only/except options reference missing actions
63+
# Raise error when a before_action's only/except options reference missing actions.
6664
config.action_controller.raise_on_missing_callback_actions = true
6765
end

config/environments/production.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
4545
# config.force_ssl = true
4646

47+
# Skip http-to-https redirect for the default health check endpoint.
48+
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
49+
4750
# Log to STDOUT by default
4851
# config.logger = ActiveSupport::Logger.new(STDOUT)
4952
# .tap { |logger| logger.formatter = ::Logger::Formatter.new }

config/environments/test.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
config.eager_load = ENV["CI"].present?
1919

2020
# Configure public file server for tests with Cache-Control for performance.
21-
config.public_file_server.enabled = true
22-
config.public_file_server.headers = {
23-
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
24-
}
21+
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" }
2522

2623
# Show full error reports and disable caching.
2724
config.consider_all_requests_local = true
@@ -49,6 +46,6 @@
4946
# Annotate rendered view with file names.
5047
# config.action_view.annotate_rendered_view_with_filenames = true
5148

52-
# Raise error when a before_action's only/except options reference missing actions
49+
# Raise error when a before_action's only/except options reference missing actions.
5350
config.action_controller.raise_on_missing_callback_actions = true
5451
end

config/initializers/assets.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# Precompile additional assets.
1010
# application.js, application.css, and all non-JS/CSS in the app/assets
1111
# folder are already added.
12-
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
12+
# Rails.application.config.assets.precompile += %w[ admin.js admin.css ]

config/initializers/filter_parameter_logging.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# Use this to limit dissemination of sensitive information.
55
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
66
Rails.application.config.filter_parameters += [
7-
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
7+
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
88
]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Be sure to restart your server when you modify this file.
2+
#
3+
# This file eases your Rails 7.2 framework defaults upgrade.
4+
#
5+
# Uncomment each configuration one by one to switch to the new default.
6+
# Once your application is ready to run with all new defaults, you can remove
7+
# this file and set the `config.load_defaults` to `7.2`.
8+
#
9+
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
10+
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
11+
12+
###
13+
# Enable validation of migration timestamps. When set, an ActiveRecord::InvalidMigrationTimestampError
14+
# will be raised if the timestamp prefix for a migration is more than a day ahead of the timestamp
15+
# associated with the current time. This is done to prevent forward-dating of migration files, which can
16+
# impact migration generation and other migration commands.
17+
#
18+
# Applications with existing timestamped migrations that do not adhere to the
19+
# expected format can disable validation by setting this config to `false`.
20+
#++
21+
Rails.application.config.active_record.validate_migration_timestamps = true
22+
23+
###
24+
# Controls whether the PostgresqlAdapter should decode dates automatically with manual queries.
25+
#
26+
# Example:
27+
# ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2024-01-01'::date") #=> Date
28+
#
29+
# This query used to return a `String`.
30+
#++
31+
Rails.application.config.active_record.postgresql_adapter_decode_dates = true
32+
33+
###
34+
# Enables YJIT as of Ruby 3.3, to bring sizeable performance improvements. If you are
35+
# deploying to a memory constrained environment you may want to set this to `false`.
36+
#++
37+
# Rails.application.config.yjit = true

public/404.html

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,66 @@
22
<html>
33
<head>
44
<title>The page you were looking for doesn't exist (404)</title>
5-
<style type="text/css">
6-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7-
div.dialog {
8-
width: 25em;
9-
padding: 0 4em;
10-
margin: 4em auto 0 auto;
11-
border: 1px solid #ccc;
12-
border-right-color: #999;
13-
border-bottom-color: #999;
14-
}
15-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
5+
<meta name="viewport" content="width=device-width,initial-scale=1">
6+
<style>
7+
.rails-default-error-page {
8+
background-color: #EFEFEF;
9+
color: #2E2F30;
10+
text-align: center;
11+
font-family: arial, sans-serif;
12+
margin: 0;
13+
}
14+
15+
.rails-default-error-page div.dialog {
16+
width: 95%;
17+
max-width: 33em;
18+
margin: 4em auto 0;
19+
}
20+
21+
.rails-default-error-page div.dialog > div {
22+
border: 1px solid #CCC;
23+
border-right-color: #999;
24+
border-left-color: #999;
25+
border-bottom-color: #BBB;
26+
border-top: #B00100 solid 4px;
27+
border-top-left-radius: 9px;
28+
border-top-right-radius: 9px;
29+
background-color: white;
30+
padding: 7px 12% 0;
31+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32+
}
33+
34+
.rails-default-error-page h1 {
35+
font-size: 100%;
36+
color: #730E15;
37+
line-height: 1.5em;
38+
}
39+
40+
.rails-default-error-page div.dialog > p {
41+
margin: 0 0 1em;
42+
padding: 1em;
43+
background-color: #F7F7F7;
44+
border: 1px solid #CCC;
45+
border-right-color: #999;
46+
border-left-color: #999;
47+
border-bottom-color: #999;
48+
border-bottom-left-radius: 4px;
49+
border-bottom-right-radius: 4px;
50+
border-top-color: #DADADA;
51+
color: #666;
52+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53+
}
1654
</style>
1755
</head>
1856

19-
<body>
57+
<body class="rails-default-error-page">
2058
<!-- This file lives in public/404.html -->
2159
<div class="dialog">
22-
<h1>The page you were looking for doesn't exist.</h1>
23-
<p>You may have mistyped the address or the page may have moved.</p>
60+
<div>
61+
<h1>The page you were looking for doesn't exist.</h1>
62+
<p>You may have mistyped the address or the page may have moved.</p>
63+
</div>
64+
<p>If you are the application owner check the logs for more information.</p>
2465
</div>
2566
</body>
2667
</html>

public/406-unsupported-browser.html

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Your browser is not supported (406)</title>
5+
<meta name="viewport" content="width=device-width,initial-scale=1">
6+
<style>
7+
.rails-default-error-page {
8+
background-color: #EFEFEF;
9+
color: #2E2F30;
10+
text-align: center;
11+
font-family: arial, sans-serif;
12+
margin: 0;
13+
}
14+
15+
.rails-default-error-page div.dialog {
16+
width: 95%;
17+
max-width: 33em;
18+
margin: 4em auto 0;
19+
}
20+
21+
.rails-default-error-page div.dialog > div {
22+
border: 1px solid #CCC;
23+
border-right-color: #999;
24+
border-left-color: #999;
25+
border-bottom-color: #BBB;
26+
border-top: #B00100 solid 4px;
27+
border-top-left-radius: 9px;
28+
border-top-right-radius: 9px;
29+
background-color: white;
30+
padding: 7px 12% 0;
31+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32+
}
33+
34+
.rails-default-error-page h1 {
35+
font-size: 100%;
36+
color: #730E15;
37+
line-height: 1.5em;
38+
}
39+
40+
.rails-default-error-page div.dialog > p {
41+
margin: 0 0 1em;
42+
padding: 1em;
43+
background-color: #F7F7F7;
44+
border: 1px solid #CCC;
45+
border-right-color: #999;
46+
border-left-color: #999;
47+
border-bottom-color: #999;
48+
border-bottom-left-radius: 4px;
49+
border-bottom-right-radius: 4px;
50+
border-top-color: #DADADA;
51+
color: #666;
52+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53+
}
54+
</style>
55+
</head>
56+
57+
<body class="rails-default-error-page">
58+
<!-- This file lives in public/406-unsupported-browser.html -->
59+
<div class="dialog">
60+
<div>
61+
<h1>Your browser is not supported.</h1>
62+
<p>Please upgrade your browser to continue.</p>
63+
</div>
64+
</div>
65+
</body>
66+
</html>

public/422.html

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,66 @@
22
<html>
33
<head>
44
<title>The change you wanted was rejected (422)</title>
5-
<style type="text/css">
6-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7-
div.dialog {
8-
width: 25em;
9-
padding: 0 4em;
10-
margin: 4em auto 0 auto;
11-
border: 1px solid #ccc;
12-
border-right-color: #999;
13-
border-bottom-color: #999;
14-
}
15-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
5+
<meta name="viewport" content="width=device-width,initial-scale=1">
6+
<style>
7+
.rails-default-error-page {
8+
background-color: #EFEFEF;
9+
color: #2E2F30;
10+
text-align: center;
11+
font-family: arial, sans-serif;
12+
margin: 0;
13+
}
14+
15+
.rails-default-error-page div.dialog {
16+
width: 95%;
17+
max-width: 33em;
18+
margin: 4em auto 0;
19+
}
20+
21+
.rails-default-error-page div.dialog > div {
22+
border: 1px solid #CCC;
23+
border-right-color: #999;
24+
border-left-color: #999;
25+
border-bottom-color: #BBB;
26+
border-top: #B00100 solid 4px;
27+
border-top-left-radius: 9px;
28+
border-top-right-radius: 9px;
29+
background-color: white;
30+
padding: 7px 12% 0;
31+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32+
}
33+
34+
.rails-default-error-page h1 {
35+
font-size: 100%;
36+
color: #730E15;
37+
line-height: 1.5em;
38+
}
39+
40+
.rails-default-error-page div.dialog > p {
41+
margin: 0 0 1em;
42+
padding: 1em;
43+
background-color: #F7F7F7;
44+
border: 1px solid #CCC;
45+
border-right-color: #999;
46+
border-left-color: #999;
47+
border-bottom-color: #999;
48+
border-bottom-left-radius: 4px;
49+
border-bottom-right-radius: 4px;
50+
border-top-color: #DADADA;
51+
color: #666;
52+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53+
}
1654
</style>
1755
</head>
1856

19-
<body>
57+
<body class="rails-default-error-page">
2058
<!-- This file lives in public/422.html -->
2159
<div class="dialog">
22-
<h1>The change you wanted was rejected.</h1>
23-
<p>Maybe you tried to change something you didn't have access to.</p>
60+
<div>
61+
<h1>The change you wanted was rejected.</h1>
62+
<p>Maybe you tried to change something you didn't have access to.</p>
63+
</div>
64+
<p>If you are the application owner check the logs for more information.</p>
2465
</div>
2566
</body>
2667
</html>

0 commit comments

Comments
 (0)