Description:
move to rails 7 and ruby 3.0.2
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r820:0b2fef7e1246 - - 14 files changed: 303 inserted, 166 deleted

@@ -0,0 +1,117
1 + # Be sure to restart your server when you modify this file.
2 + #
3 + # This file eases your Rails 7.0 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.0`.
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 + # `button_to` view helper will render `<button>` element, regardless of whether
13 + # or not the content is passed as the first argument or as a block.
14 + # Rails.application.config.action_view.button_to_generates_button_tag = true
15 +
16 + # `stylesheet_link_tag` view helper will not render the media attribute by default.
17 + # Rails.application.config.action_view.apply_stylesheet_media_default = false
18 +
19 + # Change the digest class for the key generators to `OpenSSL::Digest::SHA256`.
20 + # Changing this default means invalidate all encrypted messages generated by
21 + # your application and, all the encrypted cookies. Only change this after you
22 + # rotated all the messages using the key rotator.
23 + #
24 + # See upgrading guide for more information on how to build a rotator.
25 + # https://guides.rubyonrails.org/v7.0/upgrading_ruby_on_rails.html
26 + # Rails.application.config.active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA256
27 +
28 + # Change the digest class for ActiveSupport::Digest.
29 + # Changing this default means that for example Etags change and
30 + # various cache keys leading to cache invalidation.
31 + # Rails.application.config.active_support.hash_digest_class = OpenSSL::Digest::SHA256
32 +
33 + # Don't override ActiveSupport::TimeWithZone.name and use the default Ruby
34 + # implementation.
35 + # Rails.application.config.active_support.remove_deprecated_time_with_zone_name = true
36 +
37 + # Change the format of the cache entry.
38 + # Changing this default means that all new cache entries added to the cache
39 + # will have a different format that is not supported by Rails 6.1 applications.
40 + # Only change this value after your application is fully deployed to Rails 7.0
41 + # and you have no plans to rollback.
42 + # Rails.application.config.active_support.cache_format_version = 7.0
43 +
44 + # Calls `Rails.application.executor.wrap` around test cases.
45 + # This makes test cases behave closer to an actual request or job.
46 + # Several features that are normally disabled in test, such as Active Record query cache
47 + # and asynchronous queries will then be enabled.
48 + # Rails.application.config.active_support.executor_around_test_case = true
49 +
50 + # Define the isolation level of most of Rails internal state.
51 + # If you use a fiber based server or job processor, you should set it to `:fiber`.
52 + # Otherwise the default of `:thread` if preferable.
53 + # Rails.application.config.active_support.isolation_level = :thread
54 +
55 + # Set both the `:open_timeout` and `:read_timeout` values for `:smtp` delivery method.
56 + # Rails.application.config.action_mailer.smtp_timeout = 5
57 +
58 + # The ActiveStorage video previewer will now use scene change detection to generate
59 + # better preview images (rather than the previous default of using the first frame
60 + # of the video).
61 + # Rails.application.config.active_storage.video_preview_arguments =
62 + # "-vf 'select=eq(n\\,0)+eq(key\\,1)+gt(scene\\,0.015),loop=loop=-1:size=2,trim=start_frame=1' -frames:v 1 -f image2"
63 +
64 + # Automatically infer `inverse_of` for associations with a scope.
65 + # Rails.application.config.active_record.automatic_scope_inversing = true
66 +
67 + # Raise when running tests if fixtures contained foreign key violations
68 + # Rails.application.config.active_record.verify_foreign_keys_for_fixtures = true
69 +
70 + # Disable partial inserts.
71 + # This default means that all columns will be referenced in INSERT queries
72 + # regardless of whether they have a default or not.
73 + # Rails.application.config.active_record.partial_inserts = false
74 + #
75 + # Protect from open redirect attacks in `redirect_back_or_to` and `redirect_to`.
76 + # Rails.application.config.action_controller.raise_on_open_redirects = true
77 +
78 + # Change the variant processor for Active Storage.
79 + # Changing this default means updating all places in your code that
80 + # generate variants to use image processing macros and ruby-vips
81 + # operations. See the upgrading guide for detail on the changes required.
82 + # The `:mini_magick` option is not deprecated; it's fine to keep using it.
83 + # Rails.application.config.active_storage.variant_processor = :vips
84 +
85 + # If you're upgrading and haven't set `cookies_serializer` previously, your cookie serializer
86 + # was `:marshal`. Convert all cookies to JSON, using the `:hybrid` formatter.
87 + #
88 + # If you're confident all your cookies are JSON formatted, you can switch to the `:json` formatter.
89 + #
90 + # Continue to use `:marshal` for backward-compatibility with old cookies.
91 + #
92 + # If you have configured the serializer elsewhere, you can remove this.
93 + #
94 + # See https://guides.rubyonrails.org/action_controller_overview.html#cookies for more information.
95 + # Rails.application.config.action_dispatch.cookies_serializer = :hybrid
96 +
97 + # Enable parameter wrapping for JSON.
98 + # Previously this was set in an initializer. It's fine to keep using that initializer if you've customized it.
99 + # To disable parameter wrapping entirely, set this config to `false`.
100 + # Rails.application.config.action_controller.wrap_parameters_by_default = true
101 +
102 + # Specifies whether generated namespaced UUIDs follow the RFC 4122 standard for namespace IDs provided as a
103 + # `String` to `Digest::UUID.uuid_v3` or `Digest::UUID.uuid_v5` method calls.
104 + #
105 + # See https://guides.rubyonrails.org/configuring.html#config-active-support-use-rfc4122-namespaced-uuids for
106 + # more information.
107 + # Rails.application.config.active_support.use_rfc4122_namespaced_uuids = true
108 +
109 + # Change the default headers to disable browsers' flawed legacy XSS protection.
110 + # Rails.application.config.action_dispatch.default_headers = {
111 + # "X-Frame-Options" => "SAMEORIGIN",
112 + # "X-XSS-Protection" => "0",
113 + # "X-Content-Type-Options" => "nosniff",
114 + # "X-Download-Options" => "noopen",
115 + # "X-Permitted-Cross-Domain-Policies" => "none",
116 + # "Referrer-Policy" => "strict-origin-when-cross-origin"
117 + # }
@@ -1,13 +1,19
1 1 source 'https://rubygems.org'
2 2 git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3 3
4 + ruby '3.0.2'
5 +
4 6 #rails
5 - gem 'rails', '~>6.0'
7 + gem 'rails', '~>7.0'
8 +
9 + # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
10 + gem "sprockets-rails"
11 +
6 12 gem 'activerecord-session_store'
7 13 gem 'puma'
8 14
9 15 # Reduces boot times through caching; required in config/boot.rb
10 - gem 'bootsnap', '>= 1.1.0', require: false
16 + gem 'bootsnap', require: false
11 17
12 18 # Bundle edge Rails instead:
13 19 # gem 'rails', :git => 'git://github.com/rails/rails.git'
@@ -41,11 +47,11
41 47 # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
42 48 #gem 'turbolinks', '~> 5'
43 49 # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
44 - gem 'jbuilder', '~> 2.5'
50 + gem 'jbuilder'
45 51
46 52
47 53 #in-place editor
48 - gem 'best_in_place', '~> 3.0.1'
54 + gem 'best_in_place', git: "https://github.com/mmotherwell/best_in_place"
49 55
50 56 # jquery addition
51 57 gem 'jquery-rails'
@@ -93,7 +99,7
93 99
94 100 group :development, :test do
95 101 # Call 'byebug' anywhere in the code to stop execution and get a debugger console
96 - gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
102 + gem 'debug', platforms: [:mri, :mingw, :x64_mingw]
97 103 end
98 104
99 105 group :development do
@@ -103,14 +109,15
103 109 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
104 110 gem 'spring'
105 111 gem 'spring-watcher-listen', '~> 2.0.0'
112 +
113 + # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
114 + # gem "rack-mini-profiler"
106 115 end
107 116
108 117 group :test do
109 118 # Adds support for Capybara system testing and selenium driver
110 - gem 'capybara', '>= 2.15'
119 + gem 'capybara'
111 120 gem 'selenium-webdriver'
112 - # Easy installation and use of chromedriver to run system tests with Chrome
113 - #gem 'chromedriver-helper'
114 - gem 'webdriver'
121 + gem 'webdrivers'
115 122 end
116 123
@@ -1,3 +1,11
1 + GIT
2 + remote: https://github.com/mmotherwell/best_in_place
3 + revision: 88eb3052623a9a6cd346864d2aca05021c2f80d0
4 + specs:
5 + best_in_place (3.1.1)
6 + actionpack (>= 3.2)
7 + railties (>= 3.2)
8 +
1 9 GEM
2 10 remote: https://rubygems.org/
3 11 specs:
@@ -5,79 +13,82
5 13 ZenTest (~> 4.3)
6 14 ZenTest (4.12.0)
7 15 ace-rails-ap (4.4)
8 - actioncable (6.1.4.4)
9 - actionpack (= 6.1.4.4)
10 - activesupport (= 6.1.4.4)
16 + actioncable (7.0.1)
17 + actionpack (= 7.0.1)
18 + activesupport (= 7.0.1)
11 19 nio4r (~> 2.0)
12 20 websocket-driver (>= 0.6.1)
13 - actionmailbox (6.1.4.4)
14 - actionpack (= 6.1.4.4)
15 - activejob (= 6.1.4.4)
16 - activerecord (= 6.1.4.4)
17 - activestorage (= 6.1.4.4)
18 - activesupport (= 6.1.4.4)
21 + actionmailbox (7.0.1)
22 + actionpack (= 7.0.1)
23 + activejob (= 7.0.1)
24 + activerecord (= 7.0.1)
25 + activestorage (= 7.0.1)
26 + activesupport (= 7.0.1)
19 27 mail (>= 2.7.1)
20 - actionmailer (6.1.4.4)
21 - actionpack (= 6.1.4.4)
22 - actionview (= 6.1.4.4)
23 - activejob (= 6.1.4.4)
24 - activesupport (= 6.1.4.4)
28 + net-imap
29 + net-pop
30 + net-smtp
31 + actionmailer (7.0.1)
32 + actionpack (= 7.0.1)
33 + actionview (= 7.0.1)
34 + activejob (= 7.0.1)
35 + activesupport (= 7.0.1)
25 36 mail (~> 2.5, >= 2.5.4)
37 + net-imap
38 + net-pop
39 + net-smtp
26 40 rails-dom-testing (~> 2.0)
27 - actionpack (6.1.4.4)
28 - actionview (= 6.1.4.4)
29 - activesupport (= 6.1.4.4)
30 - rack (~> 2.0, >= 2.0.9)
41 + actionpack (7.0.1)
42 + actionview (= 7.0.1)
43 + activesupport (= 7.0.1)
44 + rack (~> 2.0, >= 2.2.0)
31 45 rack-test (>= 0.6.3)
32 46 rails-dom-testing (~> 2.0)
33 47 rails-html-sanitizer (~> 1.0, >= 1.2.0)
34 - actiontext (6.1.4.4)
35 - actionpack (= 6.1.4.4)
36 - activerecord (= 6.1.4.4)
37 - activestorage (= 6.1.4.4)
38 - activesupport (= 6.1.4.4)
48 + actiontext (7.0.1)
49 + actionpack (= 7.0.1)
50 + activerecord (= 7.0.1)
51 + activestorage (= 7.0.1)
52 + activesupport (= 7.0.1)
53 + globalid (>= 0.6.0)
39 54 nokogiri (>= 1.8.5)
40 - actionview (6.1.4.4)
41 - activesupport (= 6.1.4.4)
55 + actionview (7.0.1)
56 + activesupport (= 7.0.1)
42 57 builder (~> 3.1)
43 58 erubi (~> 1.4)
44 59 rails-dom-testing (~> 2.0)
45 60 rails-html-sanitizer (~> 1.1, >= 1.2.0)
46 - activejob (6.1.4.4)
47 - activesupport (= 6.1.4.4)
61 + activejob (7.0.1)
62 + activesupport (= 7.0.1)
48 63 globalid (>= 0.3.6)
49 - activemodel (6.1.4.4)
50 - activesupport (= 6.1.4.4)
51 - activerecord (6.1.4.4)
52 - activemodel (= 6.1.4.4)
53 - activesupport (= 6.1.4.4)
64 + activemodel (7.0.1)
65 + activesupport (= 7.0.1)
66 + activerecord (7.0.1)
67 + activemodel (= 7.0.1)
68 + activesupport (= 7.0.1)
54 69 activerecord-session_store (2.0.0)
55 70 actionpack (>= 5.2.4.1)
56 71 activerecord (>= 5.2.4.1)
57 72 multi_json (~> 1.11, >= 1.11.2)
58 73 rack (>= 2.0.8, < 3)
59 74 railties (>= 5.2.4.1)
60 - activestorage (6.1.4.4)
61 - actionpack (= 6.1.4.4)
62 - activejob (= 6.1.4.4)
63 - activerecord (= 6.1.4.4)
64 - activesupport (= 6.1.4.4)
65 - marcel (~> 1.0.0)
75 + activestorage (7.0.1)
76 + actionpack (= 7.0.1)
77 + activejob (= 7.0.1)
78 + activerecord (= 7.0.1)
79 + activesupport (= 7.0.1)
80 + marcel (~> 1.0)
66 81 mini_mime (>= 1.1.0)
67 - activesupport (6.1.4.4)
82 + activesupport (7.0.1)
68 83 concurrent-ruby (~> 1.0, >= 1.0.2)
69 84 i18n (>= 1.6, < 2)
70 85 minitest (>= 5.1)
71 86 tzinfo (~> 2.0)
72 - zeitwerk (~> 2.3)
73 87 addressable (2.8.0)
74 88 public_suffix (>= 2.0.2, < 5.0)
75 89 ansi (1.5.0)
76 90 autoprefixer-rails (10.4.2.0)
77 91 execjs (~> 2)
78 - best_in_place (3.0.3)
79 - actionpack (>= 3.2)
80 - railties (>= 3.2)
81 92 bindex (0.8.1)
82 93 bootsnap (1.9.4)
83 94 msgpack (~> 1.0)
@@ -89,7 +100,6
89 100 bootstrap3-datetimepicker-rails (4.17.47)
90 101 momentjs-rails (>= 2.8.1)
91 102 builder (3.2.4)
92 - byebug (11.1.3)
93 103 capybara (3.36.0)
94 104 addressable
95 105 matrix
@@ -109,6 +119,10
109 119 coffee-script-source (1.12.2)
110 120 concurrent-ruby (1.1.9)
111 121 crass (1.0.6)
122 + debug (1.4.0)
123 + irb (>= 1.3.6)
124 + reline (>= 0.2.7)
125 + digest (3.1.0)
112 126 dynamic_form (1.1.4)
113 127 erubi (1.10.0)
114 128 erubis (2.7.0)
@@ -135,6 +149,10
135 149 i18n (1.8.11)
136 150 concurrent-ruby (~> 1.0)
137 151 in_place_editing (1.2.0)
152 + io-console (0.5.11)
153 + io-wait (0.2.1)
154 + irb (1.4.1)
155 + reline (>= 0.3.0)
138 156 jbuilder (2.11.5)
139 157 actionview (>= 5.0.0)
140 158 activesupport (>= 5.0.0)
@@ -147,10 +165,9
147 165 railties (>= 3.2)
148 166 jquery-ui-rails (6.0.1)
149 167 railties (>= 3.2.16)
150 - listen (3.1.5)
168 + listen (3.0.8)
151 169 rb-fsevent (~> 0.9, >= 0.9.4)
152 170 rb-inotify (~> 0.9, >= 0.9.7)
153 - ruby_dep (~> 1.2)
154 171 loofah (2.13.0)
155 172 crass (~> 1.0.2)
156 173 nokogiri (>= 1.5.9)
@@ -160,7 +177,6
160 177 matrix (0.4.2)
161 178 method_source (1.0.0)
162 179 mini_mime (1.1.2)
163 - mini_portile2 (2.7.1)
164 180 minitest (5.15.0)
165 181 minitest-reporters (1.4.3)
166 182 ansi
@@ -172,9 +188,23
172 188 msgpack (1.4.2)
173 189 multi_json (1.15.0)
174 190 mysql2 (0.5.3)
191 + net-imap (0.2.3)
192 + digest
193 + net-protocol
194 + strscan
195 + net-pop (0.1.1)
196 + digest
197 + net-protocol
198 + timeout
199 + net-protocol (0.1.2)
200 + io-wait
201 + timeout
202 + net-smtp (0.3.1)
203 + digest
204 + net-protocol
205 + timeout
175 206 nio4r (2.5.8)
176 - nokogiri (1.13.1)
177 - mini_portile2 (~> 2.7.0)
207 + nokogiri (1.13.1-x86_64-linux)
178 208 racc (~> 1.4)
179 209 public_suffix (4.0.6)
180 210 puma (5.5.2)
@@ -183,21 +213,20
183 213 rack (2.2.3)
184 214 rack-test (1.1.0)
185 215 rack (>= 1.0, < 3)
186 - rails (6.1.4.4)
187 - actioncable (= 6.1.4.4)
188 - actionmailbox (= 6.1.4.4)
189 - actionmailer (= 6.1.4.4)
190 - actionpack (= 6.1.4.4)
191 - actiontext (= 6.1.4.4)
192 - actionview (= 6.1.4.4)
193 - activejob (= 6.1.4.4)
194 - activemodel (= 6.1.4.4)
195 - activerecord (= 6.1.4.4)
196 - activestorage (= 6.1.4.4)
197 - activesupport (= 6.1.4.4)
216 + rails (7.0.1)
217 + actioncable (= 7.0.1)
218 + actionmailbox (= 7.0.1)
219 + actionmailer (= 7.0.1)
220 + actionpack (= 7.0.1)
221 + actiontext (= 7.0.1)
222 + actionview (= 7.0.1)
223 + activejob (= 7.0.1)
224 + activemodel (= 7.0.1)
225 + activerecord (= 7.0.1)
226 + activestorage (= 7.0.1)
227 + activesupport (= 7.0.1)
198 228 bundler (>= 1.15.0)
199 - railties (= 6.1.4.4)
200 - sprockets-rails (>= 2.0.0)
229 + railties (= 7.0.1)
201 230 rails-controller-testing (1.0.5)
202 231 actionpack (>= 5.0.1.rc1)
203 232 actionview (>= 5.0.1.rc1)
@@ -209,22 +238,24
209 238 loofah (~> 2.3)
210 239 rails_bootstrap_sortable (2.0.7)
211 240 momentjs-rails (>= 2.8.3)
212 - railties (6.1.4.4)
213 - actionpack (= 6.1.4.4)
214 - activesupport (= 6.1.4.4)
241 + railties (7.0.1)
242 + actionpack (= 7.0.1)
243 + activesupport (= 7.0.1)
215 244 method_source
216 - rake (>= 0.13)
245 + rake (>= 12.2)
217 246 thor (~> 1.0)
247 + zeitwerk (~> 2.5)
218 248 rake (13.0.6)
219 249 rb-fsevent (0.11.0)
220 250 rb-inotify (0.10.1)
221 251 ffi (~> 1.0)
222 252 rdiscount (2.2.0.2)
223 253 regexp_parser (2.2.0)
254 + reline (0.3.1)
255 + io-console (~> 0.5)
224 256 rexml (3.2.5)
225 257 rouge (3.27.0)
226 258 ruby-progressbar (1.11.0)
227 - ruby_dep (1.5.0)
228 259 ruby_parser (3.18.1)
229 260 sexp_processor (~> 4.16)
230 261 rubyzip (2.3.2)
@@ -257,9 +288,11
257 288 activesupport (>= 5.2)
258 289 sprockets (>= 3.0.0)
259 290 sqlite3 (1.4.2)
291 + strscan (3.0.1)
260 292 temple (0.8.2)
261 293 thor (1.2.1)
262 294 tilt (2.0.10)
295 + timeout (0.2.0)
263 296 tzinfo (2.0.4)
264 297 concurrent-ruby (~> 1.0)
265 298 uglifier (4.2.0)
@@ -269,7 +302,10
269 302 activemodel (>= 6.0.0)
270 303 bindex (>= 0.4.0)
271 304 railties (>= 6.0.0)
272 - webdriver (0.19.0)
305 + webdrivers (5.0.0)
306 + nokogiri (~> 1.6)
307 + rubyzip (>= 1.3.0)
308 + selenium-webdriver (~> 4.0)
273 309 websocket-driver (0.7.5)
274 310 websocket-extensions (>= 0.1.0)
275 311 websocket-extensions (0.1.5)
@@ -281,27 +317,27
281 317 zeitwerk (2.5.3)
282 318
283 319 PLATFORMS
284 - ruby
320 + x86_64-linux
285 321
286 322 DEPENDENCIES
287 323 ace-rails-ap
288 324 activerecord-session_store
289 325 autoprefixer-rails
290 - best_in_place (~> 3.0.1)
291 - bootsnap (>= 1.1.0)
326 + best_in_place!
327 + bootsnap
292 328 bootstrap-sass (~> 3.4.1)
293 329 bootstrap-switch-rails
294 330 bootstrap-toggle-rails
295 331 bootstrap3-datetimepicker-rails (~> 4.17.47)
296 - byebug
297 - capybara (>= 2.15)
332 + capybara
298 333 coffee-rails
334 + debug
299 335 dynamic_form
300 336 fuzzy-string-match
301 337 haml
302 338 haml-rails
303 339 in_place_editing
304 - jbuilder (~> 2.5)
340 + jbuilder
305 341 jquery-countdown-rails
306 342 jquery-rails
307 343 jquery-tablesorter
@@ -312,7 +348,7
312 348 momentjs-rails (>= 2.9.0)
313 349 mysql2
314 350 puma
315 - rails (~> 6.0)
351 + rails (~> 7.0)
316 352 rails-controller-testing
317 353 rails_bootstrap_sortable
318 354 rdiscount
@@ -323,11 +359,15
323 359 simple_form
324 360 spring
325 361 spring-watcher-listen (~> 2.0.0)
362 + sprockets-rails
326 363 sqlite3
327 364 uglifier
328 365 web-console (>= 3.3.0)
329 - webdriver
366 + webdrivers
330 367 yaml_db
331 368
369 + RUBY VERSION
370 + ruby 3.0.2p107
371 +
332 372 BUNDLED WITH
333 - 1.17.2
373 + 2.3.5
@@ -1,5 +1,4
1 1 #!/usr/bin/env ruby
2 - load File.expand_path("spring", __dir__)
3 - APP_PATH = File.expand_path('../config/application', __dir__)
2 + APP_PATH = File.expand_path("../config/application", __dir__)
4 3 require_relative "../config/boot"
5 4 require "rails/commands"
@@ -1,5 +1,4
1 1 #!/usr/bin/env ruby
2 - load File.expand_path("spring", __dir__)
3 2 require_relative "../config/boot"
4 3 require "rake"
5 4 Rake.application.run
@@ -2,7 +2,7
2 2 require "fileutils"
3 3
4 4 # path to your application root.
5 - APP_ROOT = File.expand_path('..', __dir__)
5 + APP_ROOT = File.expand_path("..", __dir__)
6 6
7 7 def system!(*args)
8 8 system(*args) || abort("\n== Command #{args} failed ==")
@@ -13,24 +13,21
13 13 # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14 14 # Add necessary setup steps to this file.
15 15
16 - puts '== Installing dependencies =='
17 - system! 'gem install bundler --conservative'
18 - system('bundle check') || system!('bundle install')
19 -
20 - # Install JavaScript dependencies
21 - system! 'bin/yarn'
16 + puts "== Installing dependencies =="
17 + system! "gem install bundler --conservative"
18 + system("bundle check") || system!("bundle install")
22 19
23 20 # puts "\n== Copying sample files =="
24 - # unless File.exist?('config/database.yml')
25 - # FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
21 + # unless File.exist?("config/database.yml")
22 + # FileUtils.cp "config/database.yml.sample", "config/database.yml"
26 23 # end
27 24
28 25 puts "\n== Preparing database =="
29 - system! 'bin/rails db:prepare'
26 + system! "bin/rails db:prepare"
30 27
31 28 puts "\n== Removing old logs and tempfiles =="
32 - system! 'bin/rails log:clear tmp:clear'
29 + system! "bin/rails log:clear tmp:clear"
33 30
34 31 puts "\n== Restarting application server =="
35 - system! 'bin/rails restart'
32 + system! "bin/rails restart"
36 33 end
@@ -1,4 +1,4
1 - ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
1 + ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2 2
3 3 require "bundler/setup" # Set up gems listed in the Gemfile.
4 4 require "bootsnap/setup" # Speed up boot time by caching expensive operations.
@@ -1,3 +1,5
1 + require "active_support/core_ext/integer/time"
2 +
1 3 Rails.application.configure do
2 4 # Settings specified here will take precedence over those in config/application.rb.
3 5
@@ -12,15 +14,18
12 14 # Show full error reports.
13 15 config.consider_all_requests_local = true
14 16
17 + # Enable server timing
18 + config.server_timing = true
19 +
15 20 # Enable/disable caching. By default caching is disabled.
16 21 # Run rails dev:cache to toggle caching.
17 - if Rails.root.join('tmp', 'caching-dev.txt').exist?
22 + if Rails.root.join("tmp/caching-dev.txt").exist?
18 23 config.action_controller.perform_caching = true
19 24 config.action_controller.enable_fragment_cache_logging = true
20 25
21 26 config.cache_store = :memory_store
22 27 config.public_file_server.headers = {
23 - 'Cache-Control' => "public, max-age=#{2.days.to_i}"
28 + "Cache-Control" => "public, max-age=#{2.days.to_i}"
24 29 }
25 30 else
26 31 config.action_controller.perform_caching = false
@@ -65,10 +70,6
65 70 # Annotate rendered view with file names.
66 71 # config.action_view.annotate_rendered_view_with_filenames = true
67 72
68 - # Use an evented file watcher to asynchronously detect changes in source code,
69 - # routes, locales, etc. This feature depends on the listen gem.
70 - config.file_watcher = ActiveSupport::EventedFileUpdateChecker
71 -
72 73 # Uncomment if you wish to allow Action Cable access from any origin.
73 74 # config.action_cable.disable_request_forgery_protection = true
74 75 end
@@ -1,3 +1,5
1 + require "active_support/core_ext/integer/time"
2 +
1 3 Rails.application.configure do
2 4 # Settings specified here will take precedence over those in config/application.rb.
3 5
@@ -20,7 +22,7
20 22
21 23 # Disable serving static files from the `/public` folder by default since
22 24 # Apache or NGINX already handles this.
23 - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
25 + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
24 26
25 27 # Compress CSS using a preprocessor.
26 28 # config.assets.css_compressor = :sass
@@ -29,19 +31,19
29 31 config.assets.compile = false
30 32
31 33 # Enable serving of images, stylesheets, and JavaScripts from an asset server.
32 - # config.asset_host = 'http://assets.example.com'
34 + # config.asset_host = "http://assets.example.com"
33 35
34 36 # Specifies the header that your server uses for sending files.
35 - # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
36 - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
37 + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
38 + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
37 39
38 40 # Store uploaded files on the local file system (see config/storage.yml for options).
39 41 config.active_storage.service = :local
40 42
41 43 # Mount Action Cable outside main process or domain.
42 44 # config.action_cable.mount_path = nil
43 - # config.action_cable.url = 'wss://example.com/cable'
44 - # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
45 + # config.action_cable.url = "wss://example.com/cable"
46 + # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
45 47
46 48 # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
47 49 # config.force_ssl = true
@@ -83,8 +85,8
83 85 config.log_formatter = ::Logger::Formatter.new
84 86
85 87 # Use a different logger for distributed setups.
86 - # require 'syslog/logger'
87 - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
88 + # require "syslog/logger"
89 + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
88 90
89 91 if ENV["RAILS_LOG_TO_STDOUT"].present?
90 92 logger = ActiveSupport::Logger.new(STDOUT)
@@ -94,25 +96,4
94 96
95 97 # Do not dump schema after migrations.
96 98 config.active_record.dump_schema_after_migration = false
97 -
98 - # Inserts middleware to perform automatic connection switching.
99 - # The `database_selector` hash is used to pass options to the DatabaseSelector
100 - # middleware. The `delay` is used to determine how long to wait after a write
101 - # to send a subsequent read to the primary.
102 - #
103 - # The `database_resolver` class is used by the middleware to determine which
104 - # database is appropriate to use based on the time delay.
105 - #
106 - # The `database_resolver_context` class is used by the middleware to set
107 - # timestamps for the last write to the primary. The resolver uses the context
108 - # class timestamps to determine how long to wait before reading from the
109 - # replica.
110 - #
111 - # By default Rails will store a last write timestamp in the session. The
112 - # DatabaseSelector middleware is designed as such you can define your own
113 - # strategy for connection switching and pass that into the middleware through
114 - # these configuration options.
115 - # config.active_record.database_selector = { delay: 2.seconds }
116 - # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
117 - # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
118 99 end
@@ -8,18 +8,18
8 8 Rails.application.configure do
9 9 # Settings specified here will take precedence over those in config/application.rb.
10 10
11 - config.cache_classes = false
12 - config.action_view.cache_template_loading = true
11 + # Turn false under Spring and add config.action_view.cache_template_loading = true.
12 + config.cache_classes = true
13 13
14 - # Do not eager load code on boot. This avoids loading your whole application
15 - # just for the purpose of running a single test. If you are using a tool that
16 - # preloads Rails for running tests, you may have to set it to true.
17 - config.eager_load = false
14 + # Eager loading loads your whole application. When running a single test locally,
15 + # this probably isn't necessary. It's a good idea to do in a continuous integration
16 + # system, or in some way before deploying your code.
17 + config.eager_load = ENV["CI"].present?
18 18
19 19 # Configure public file server for tests with Cache-Control for performance.
20 20 config.public_file_server.enabled = true
21 21 config.public_file_server.headers = {
22 - 'Cache-Control' => "public, max-age=#{1.hour.to_i}"
22 + "Cache-Control" => "public, max-age=#{1.hour.to_i}"
23 23 }
24 24
25 25 # Show full error reports and disable caching.
@@ -1,7 +1,7
1 1 # Be sure to restart your server when you modify this file.
2 2
3 3 # Version of your assets, change this if you want to expire all your assets.
4 - Rails.application.config.assets.version = '1.0'
4 + Rails.application.config.assets.version = "1.0"
5 5
6 6 # Add additional assets to the asset load path.
7 7 # Rails.application.config.assets.paths << Emoji.images_path
@@ -4,27 +4,23
4 4 # For further information see the following documentation
5 5 # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6 6
7 - # Rails.application.config.content_security_policy do |policy|
7 + # Rails.application.configure do
8 + # config.content_security_policy do |policy|
8 9 # policy.default_src :self, :https
9 10 # policy.font_src :self, :https, :data
10 11 # policy.img_src :self, :https, :data
11 12 # policy.object_src :none
12 13 # policy.script_src :self, :https
13 14 # policy.style_src :self, :https
14 - # # If you are using webpack-dev-server then specify webpack-dev-server host
15 - # policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
16 -
17 15 # # Specify URI for violation reports
18 16 # # policy.report_uri "/csp-violation-report-endpoint"
19 17 # end
20 -
21 - # If you are using UJS then enable automatic nonce generation
22 - # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
23 -
24 - # Set the nonce only to specific directives
25 - # Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
26 -
27 - # Report CSP violations to a specified URI
28 - # For further information see the following documentation:
29 - # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
30 - # Rails.application.config.content_security_policy_report_only = true
18 + #
19 + # # Generate session nonces for permitted importmap and inline scripts
20 + # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21 + # config.content_security_policy_nonce_directives = %w(script-src)
22 + #
23 + # # Report CSP violations to a specified URI. See:
24 + # # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
25 + # # config.content_security_policy_report_only = true
26 + # end
@@ -4,13 +4,13
4 4 # are locale specific, and you may define rules for as many different
5 5 # locales as you wish. All of these examples are active by default:
6 6 # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 - # inflect.plural /^(ox)$/i, '\1en'
8 - # inflect.singular /^(ox)en/i, '\1'
9 - # inflect.irregular 'person', 'people'
7 + # inflect.plural /^(ox)$/i, "\\1en"
8 + # inflect.singular /^(ox)en/i, "\\1"
9 + # inflect.irregular "person", "people"
10 10 # inflect.uncountable %w( fish sheep )
11 11 # end
12 12
13 13 # These inflection rules are supported but not enabled by default:
14 14 # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 - # inflect.acronym 'RESTful'
15 + # inflect.acronym "RESTful"
16 16 # end
You need to be logged in to leave comments. Login now