-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path5_1_release_notes.html
794 lines (753 loc) · 52.2 KB
/
5_1_release_notes.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ruby on Rails 5.1 Release Notes — Ruby on Rails Guides</title>
<link rel="stylesheet" type="text/css" href="stylesheets/style.css" data-turbolinks-track="reload">
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
<link rel="stylesheet" type="text/css" href="stylesheets/syntaxhighlighter/shCore.css" data-turbolinks-track="reload">
<link rel="stylesheet" type="text/css" href="stylesheets/syntaxhighlighter/shThemeRailsGuides.css" data-turbolinks-track="reload">
<link rel="stylesheet" type="text/css" href="stylesheets/fixes.css" data-turbolinks-track="reload">
<link href="images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<script src="javascripts/syntaxhighlighter.js" data-turbolinks-track="reload"></script>
<script src="javascripts/turbolinks.js" data-turbolinks-track="reload"></script>
<script src="javascripts/guides.js" data-turbolinks-track="reload"></script>
<script src="javascripts/responsive-tables.js" data-turbolinks-track="reload"></script>
<meta property="og:title" content="Ruby on Rails 5.1 Release Notes — Ruby on Rails Guides" />
<meta name="description" content="Ruby on Rails 5.1 Release NotesHighlights in Rails 5.1: Yarn Support Optional Webpack support jQuery no longer a default dependency System tests Encrypted secrets Parameterized mailers Direct &amp; resolved routes Unification of form_for and form_tag into form_with These release notes cover only the major changes. To learn about various bug fixes and changes, please refer to the change logs or check out the list of commits in the main Rails repository on GitHub." />
<meta property="og:description" content="Ruby on Rails 5.1 Release NotesHighlights in Rails 5.1: Yarn Support Optional Webpack support jQuery no longer a default dependency System tests Encrypted secrets Parameterized mailers Direct &amp; resolved routes Unification of form_for and form_tag into form_with These release notes cover only the major changes. To learn about various bug fixes and changes, please refer to the change logs or check out the list of commits in the main Rails repository on GitHub." />
<meta property="og:locale" content="en_US" />
<meta property="og:site_name" content="Ruby on Rails Guides" />
<meta property="og:image" content="https://avatars.githubusercontent.com/u/4223" />
<meta property="og:type" content="website" />
</head>
<body class="guide">
<div id="topNav">
<div class="wrapper">
<strong class="more-info-label">공식 웹사이트 <a href="https://rubyonrails.org/">rubyonrails.org:</a> </strong>
<span class="red-button more-info-button">
루비온레일스 웹사이트
</span>
<ul class="more-info-links s-hidden">
<li class="more-info"><a href="https://weblog.rubyonrails.org/">블로그</a></li>
<li class="more-info"><a href="https://guides.rubyonrails.org/">영문가이드</a></li>
<li class="more-info"><a href="https://api.rubyonrails.org/">레일스API</a></li>
<li class="more-info"><a href="https://stackoverflow.com/questions/tagged/ruby-on-rails">질문하기</a></li>
<li class="more-info"><a href="https://github.com/rails/rails">GitHub에서 기여하기</a></li>
</ul>
</div>
</div>
<div id="header">
<div class="wrapper clearfix">
<h1><a href="index.html" title="Return to home page">Guides.rubyonrails.org</a></h1>
<ul class="nav">
<li><a class="nav-item" href="index.html">홈</a></li>
<li class="guides-index guides-index-large">
<a href="index.html" id="guidesMenu" class="guides-index-item nav-item">가이드 인덱스</a>
<div id="guides" class="clearfix" style="display: none;">
<hr />
<div class="guides-section-container">
<div class="guides-section">
<dt>시작하면서</dt>
<dd><a href="getting_started.html">레일스로 시작하기</a></dd>
</div>
<div class="guides-section">
<dt>모델</dt>
<dd><a href="active_record_basics.html">액티브 레코드 기본</a></dd>
<dd><a href="active_record_migrations.html">액티브 레코드 마이그레이션</a></dd>
<dd><a href="active_record_validations.html">액티브 레코드 유효성 검증</a></dd>
<dd><a href="active_record_callbacks.html">액티브 레코드 콜백</a></dd>
<dd><a href="association_basics.html">Active Record Associations</a></dd>
<dd><a href="active_record_querying.html">Active Record Query Interface</a></dd>
</div>
<div class="guides-section">
<dt>Views</dt>
<dd><a href="layouts_and_rendering.html">Layouts and Rendering in Rails</a></dd>
<dd><a href="form_helpers.html">Action View Form Helpers</a></dd>
</div>
<div class="guides-section">
<dt>Controllers</dt>
<dd><a href="action_controller_overview.html">Action Controller Overview</a></dd>
<dd><a href="routing.html">Rails Routing from the Outside In</a></dd>
</div>
<div class="guides-section">
<dt>Other Components</dt>
<dd><a href="active_support_core_extensions.html">Active Support Core Extensions</a></dd>
<dd><a href="action_mailer_basics.html">Action Mailer Basics</a></dd>
<dd><a href="active_job_basics.html">Active Job Basics</a></dd>
<dd><a href="active_storage_overview.html">Active Storage Overview</a></dd>
<dd><a href="action_cable_overview.html">Action Cable Overview</a></dd>
</div>
<div class="guides-section">
<dt>Digging Deeper</dt>
<dd><a href="i18n.html">Rails Internationalization (I18n) API</a></dd>
<dd><a href="testing.html">Testing Rails Applications</a></dd>
<dd><a href="security.html">Securing Rails Applications</a></dd>
<dd><a href="debugging_rails_applications.html">Debugging Rails Applications</a></dd>
<dd><a href="configuring.html">Configuring Rails Applications</a></dd>
<dd><a href="command_line.html">The Rails Command Line</a></dd>
<dd><a href="asset_pipeline.html">The Asset Pipeline</a></dd>
<dd><a href="working_with_javascript_in_rails.html">Working with JavaScript in Rails</a></dd>
<dd><a href="autoloading_and_reloading_constants.html">Autoloading and Reloading Constants (Zeitwerk Mode)</a></dd>
<dd><a href="autoloading_and_reloading_constants_classic_mode.html">Autoloading and Reloading Constants (Classic Mode)</a></dd>
<dd><a href="caching_with_rails.html">Caching with Rails: An Overview</a></dd>
<dd><a href="api_app.html">Using Rails for API-only Applications</a></dd>
</div>
<div class="guides-section">
<dt>Extending Rails</dt>
<dd><a href="rails_on_rack.html">Rails on Rack</a></dd>
<dd><a href="generators.html">Creating and Customizing Rails Generators & Templates</a></dd>
</div>
<div class="guides-section">
<dt>Contributions</dt>
<dd><a href="contributing_to_ruby_on_rails.html">Contributing to Ruby on Rails</a></dd>
<dd><a href="api_documentation_guidelines.html">API Documentation Guidelines</a></dd>
<dd><a href="ruby_on_rails_guides_guidelines.html">Guides Guidelines</a></dd>
</div>
<div class="guides-section">
<dt>Policies</dt>
<dd><a href="maintenance_policy.html">Maintenance Policy</a></dd>
</div>
<div class="guides-section">
<dt>Release Notes</dt>
<dd><a href="upgrading_ruby_on_rails.html">Upgrading Ruby on Rails</a></dd>
<dd><a href="6_0_release_notes.html">Version 6.0 - August 2019</a></dd>
<dd><a href="5_2_release_notes.html">Version 5.2 - April 2018</a></dd>
<dd><a href="5_1_release_notes.html">Version 5.1 - April 2017</a></dd>
<dd><a href="5_0_release_notes.html">Version 5.0 - June 2016</a></dd>
<dd><a href="4_2_release_notes.html">Version 4.2 - December 2014</a></dd>
<dd><a href="4_1_release_notes.html">Version 4.1 - April 2014</a></dd>
<dd><a href="4_0_release_notes.html">Version 4.0 - June 2013</a></dd>
<dd><a href="3_2_release_notes.html">Version 3.2 - January 2012</a></dd>
<dd><a href="3_1_release_notes.html">Version 3.1 - August 2011</a></dd>
<dd><a href="3_0_release_notes.html">Version 3.0 - August 2010</a></dd>
<dd><a href="2_3_release_notes.html">Version 2.3 - March 2009</a></dd>
<dd><a href="2_2_release_notes.html">Version 2.2 - November 2008</a></dd>
</div>
</div>
</div>
</li>
<li><a class="nav-item" href="contributing_to_ruby_on_rails.html">기여하기</a></li>
<li class="guides-index guides-index-small">
<select class="guides-index-item nav-item">
<option value="index.html">가이드 인덱스</option>
<optgroup label="시작하면서">
<option value="getting_started.html">레일스로 시작하기</option>
</optgroup>
<optgroup label="모델">
<option value="active_record_basics.html">액티브 레코드 기본</option>
<option value="active_record_migrations.html">액티브 레코드 마이그레이션</option>
<option value="active_record_validations.html">액티브 레코드 유효성 검증</option>
<option value="active_record_callbacks.html">액티브 레코드 콜백</option>
<option value="association_basics.html">Active Record Associations</option>
<option value="active_record_querying.html">Active Record Query Interface</option>
</optgroup>
<optgroup label="Views">
<option value="layouts_and_rendering.html">Layouts and Rendering in Rails</option>
<option value="form_helpers.html">Action View Form Helpers</option>
</optgroup>
<optgroup label="Controllers">
<option value="action_controller_overview.html">Action Controller Overview</option>
<option value="routing.html">Rails Routing from the Outside In</option>
</optgroup>
<optgroup label="Other Components">
<option value="active_support_core_extensions.html">Active Support Core Extensions</option>
<option value="action_mailer_basics.html">Action Mailer Basics</option>
<option value="active_job_basics.html">Active Job Basics</option>
<option value="active_storage_overview.html">Active Storage Overview</option>
<option value="action_cable_overview.html">Action Cable Overview</option>
</optgroup>
<optgroup label="Digging Deeper">
<option value="i18n.html">Rails Internationalization (I18n) API</option>
<option value="testing.html">Testing Rails Applications</option>
<option value="security.html">Securing Rails Applications</option>
<option value="debugging_rails_applications.html">Debugging Rails Applications</option>
<option value="configuring.html">Configuring Rails Applications</option>
<option value="command_line.html">The Rails Command Line</option>
<option value="asset_pipeline.html">The Asset Pipeline</option>
<option value="working_with_javascript_in_rails.html">Working with JavaScript in Rails</option>
<option value="autoloading_and_reloading_constants.html">Autoloading and Reloading Constants (Zeitwerk Mode)</option>
<option value="autoloading_and_reloading_constants_classic_mode.html">Autoloading and Reloading Constants (Classic Mode)</option>
<option value="caching_with_rails.html">Caching with Rails: An Overview</option>
<option value="api_app.html">Using Rails for API-only Applications</option>
</optgroup>
<optgroup label="Extending Rails">
<option value="rails_on_rack.html">Rails on Rack</option>
<option value="generators.html">Creating and Customizing Rails Generators & Templates</option>
</optgroup>
<optgroup label="Contributions">
<option value="contributing_to_ruby_on_rails.html">Contributing to Ruby on Rails</option>
<option value="api_documentation_guidelines.html">API Documentation Guidelines</option>
<option value="ruby_on_rails_guides_guidelines.html">Guides Guidelines</option>
</optgroup>
<optgroup label="Policies">
<option value="maintenance_policy.html">Maintenance Policy</option>
</optgroup>
<optgroup label="Release Notes">
<option value="upgrading_ruby_on_rails.html">Upgrading Ruby on Rails</option>
<option value="6_0_release_notes.html">Version 6.0 - August 2019</option>
<option value="5_2_release_notes.html">Version 5.2 - April 2018</option>
<option value="5_1_release_notes.html">Version 5.1 - April 2017</option>
<option value="5_0_release_notes.html">Version 5.0 - June 2016</option>
<option value="4_2_release_notes.html">Version 4.2 - December 2014</option>
<option value="4_1_release_notes.html">Version 4.1 - April 2014</option>
<option value="4_0_release_notes.html">Version 4.0 - June 2013</option>
<option value="3_2_release_notes.html">Version 3.2 - January 2012</option>
<option value="3_1_release_notes.html">Version 3.1 - August 2011</option>
<option value="3_0_release_notes.html">Version 3.0 - August 2010</option>
<option value="2_3_release_notes.html">Version 2.3 - March 2009</option>
<option value="2_2_release_notes.html">Version 2.2 - November 2008</option>
</optgroup>
</select>
</li>
</ul>
</div>
</div>
<hr class="hide" />
<div id="feature">
<div class="wrapper">
<h2>Ruby on Rails 5.1 Release Notes</h2><p>Highlights in Rails 5.1:</p>
<ul>
<li>Yarn Support</li>
<li>Optional Webpack support</li>
<li>jQuery no longer a default dependency</li>
<li>System tests</li>
<li>Encrypted secrets</li>
<li>Parameterized mailers</li>
<li>Direct & resolved routes</li>
<li>Unification of form_for and form_tag into form_with</li>
</ul>
<p>These release notes cover only the major changes. To learn about various bug
fixes and changes, please refer to the change logs or check out the <a href="https://github.com/rails/rails/commits/5-1-stable">list of
commits</a> in the main Rails
repository on GitHub.</p>
<div id="subCol">
<h3 class="chapter"><img src="images/chapters_icon.gif" alt="" />Chapters</h3>
<ol class="chapters">
<li><a href="#upgrading-to-rails-5-1">Upgrading to Rails 5.1</a></li>
<li>
<a href="#major-features">Major Features</a>
<ul>
<li><a href="#yarn-support">Yarn Support</a></li>
<li><a href="#optional-webpack-support">Optional Webpack support</a></li>
<li><a href="#jquery-no-longer-a-default-dependency">jQuery no longer a default dependency</a></li>
<li><a href="#system-tests">System tests</a></li>
<li><a href="#encrypted-secrets">Encrypted secrets</a></li>
<li><a href="#parameterized-mailers">Parameterized mailers</a></li>
<li><a href="#direct-resolved-routes">Direct & resolved routes</a></li>
<li><a href="#unification-of-form-for-and-form-tag-into-form-with">Unification of form_for and form_tag into form_with</a></li>
</ul>
</li>
<li>
<a href="#incompatibilities">Incompatibilities</a>
<ul>
<li><a href="#transactional-tests-with-multiple-connections">Transactional tests with multiple connections</a></li>
</ul>
</li>
<li>
<a href="#railties">Railties</a>
<ul>
<li><a href="#railties-removals">Removals</a></li>
<li><a href="#railties-notable-changes">Notable changes</a></li>
</ul>
</li>
<li>
<a href="#action-cable">Action Cable</a>
<ul>
<li><a href="#action-cable-notable-changes">Notable changes</a></li>
</ul>
</li>
<li>
<a href="#action-pack">Action Pack</a>
<ul>
<li><a href="#action-pack-removals">Removals</a></li>
<li><a href="#action-pack-deprecations">Deprecations</a></li>
<li><a href="#action-pack-notable-changes">Notable changes</a></li>
</ul>
</li>
<li>
<a href="#action-view">Action View</a>
<ul>
<li><a href="#action-view-removals">Removals</a></li>
<li><a href="#action-view-deprecations">Deprecations</a></li>
<li><a href="#action-view-notable-changes">Notable changes</a></li>
</ul>
</li>
<li>
<a href="#action-mailer">Action Mailer</a>
<ul>
<li><a href="#action-mailer-notable-changes">Notable changes</a></li>
</ul>
</li>
<li>
<a href="#active-record">Active Record</a>
<ul>
<li><a href="#active-record-removals">Removals</a></li>
<li><a href="#active-record-deprecations">Deprecations</a></li>
<li><a href="#active-record-notable-changes">Notable changes</a></li>
</ul>
</li>
<li>
<a href="#active-model">Active Model</a>
<ul>
<li><a href="#active-model-removals">Removals</a></li>
<li><a href="#active-model-notable-changes">Notable changes</a></li>
</ul>
</li>
<li>
<a href="#active-job">Active Job</a>
<ul>
<li><a href="#active-job-removals">Removals</a></li>
<li><a href="#active-job-notable-changes">Notable changes</a></li>
</ul>
</li>
<li>
<a href="#active-support">Active Support</a>
<ul>
<li><a href="#removals">Removals</a></li>
<li><a href="#active-support-deprecations">Deprecations</a></li>
<li><a href="#notable-changes">Notable changes</a></li>
</ul>
</li>
<li><a href="#credits">Credits</a></li>
</ol>
</div>
</div>
</div>
<div id="container">
<div class="wrapper">
<div id="mainCol">
<h3 id="upgrading-to-rails-5-1"><a class="anchorlink" href="#upgrading-to-rails-5-1">1 Upgrading to Rails 5.1</a></h3><p>If you're upgrading an existing application, it's a great idea to have good test
coverage before going in. You should also first upgrade to Rails 5.0 in case you
haven't and make sure your application still runs as expected before attempting
an update to Rails 5.1. A list of things to watch out for when upgrading is
available in the
<a href="upgrading_ruby_on_rails.html#upgrading-from-rails-5-0-to-rails-5-1">Upgrading Ruby on Rails</a>
guide.</p><h3 id="major-features"><a class="anchorlink" href="#major-features">2 Major Features</a></h3><h4 id="yarn-support"><a class="anchorlink" href="#yarn-support">2.1 Yarn Support</a></h4><p><a href="https://github.com/rails/rails/pull/26836">Pull Request</a></p><p>Rails 5.1 allows managing JavaScript dependencies
from npm via Yarn. This will make it easy to use libraries like React, VueJS
or any other library from npm world. The Yarn support is integrated with
the asset pipeline so that all dependencies will work seamlessly with the
Rails 5.1 app.</p><h4 id="optional-webpack-support"><a class="anchorlink" href="#optional-webpack-support">2.2 Optional Webpack support</a></h4><p><a href="https://github.com/rails/rails/pull/27288">Pull Request</a></p><p>Rails apps can integrate with <a href="https://webpack.js.org/">Webpack</a>, a JavaScript
asset bundler, more easily using the new <a href="https://github.com/rails/webpacker">Webpacker</a>
gem. Use the <code>--webpack</code> flag when generating new applications to enable Webpack
integration.</p><p>This is fully compatible with the asset pipeline, which you can continue to use for
images, fonts, sounds, and other assets. You can even have some JavaScript code
managed by the asset pipeline, and other code processed via Webpack. All of this is managed
by Yarn, which is enabled by default.</p><h4 id="jquery-no-longer-a-default-dependency"><a class="anchorlink" href="#jquery-no-longer-a-default-dependency">2.3 jQuery no longer a default dependency</a></h4><p><a href="https://github.com/rails/rails/pull/27113">Pull Request</a></p><p>jQuery was required by default in earlier versions of Rails to provide features
like <code>data-remote</code>, <code>data-confirm</code> and other parts of Rails' Unobtrusive JavaScript
offerings. It is no longer required, as the UJS has been rewritten to use plain,
vanilla JavaScript. This code now ships inside of Action View as
<code>rails-ujs</code>.</p><p>You can still use jQuery if needed, but it is no longer required by default.</p><h4 id="system-tests"><a class="anchorlink" href="#system-tests">2.4 System tests</a></h4><p><a href="https://github.com/rails/rails/pull/26703">Pull Request</a></p><p>Rails 5.1 has baked-in support for writing Capybara tests, in the form of
System tests. You no longer need to worry about configuring Capybara and
database cleaning strategies for such tests. Rails 5.1 provides a wrapper
for running tests in Chrome with additional features such as failure
screenshots.</p><h4 id="encrypted-secrets"><a class="anchorlink" href="#encrypted-secrets">2.5 Encrypted secrets</a></h4><p><a href="https://github.com/rails/rails/pull/28038">Pull Request</a></p><p>Rails now allows management of application secrets in a secure way,
inspired by the <a href="https://github.com/ahoward/sekrets">sekrets</a> gem.</p><p>Run <code>bin/rails secrets:setup</code> to setup a new encrypted secrets file. This will
also generate a master key, which must be stored outside of the repository. The
secrets themselves can then be safely checked into the revision control system,
in an encrypted form.</p><p>Secrets will be decrypted in production, using a key stored either in the
<code>RAILS_MASTER_KEY</code> environment variable, or in a key file.</p><h4 id="parameterized-mailers"><a class="anchorlink" href="#parameterized-mailers">2.6 Parameterized mailers</a></h4><p><a href="https://github.com/rails/rails/pull/27825">Pull Request</a></p><p>Allows specifying common parameters used for all methods in a mailer class in
order to share instance variables, headers, and other common setup.</p><div class="code_container">
<pre class="brush: ruby; gutter: false; toolbar: false">
class InvitationsMailer < ApplicationMailer
before_action { @inviter, @invitee = params[:inviter], params[:invitee] }
before_action { @account = params[:inviter].account }
def account_invitation
mail subject: "#{@inviter.name} invited you to their Basecamp (#{@account.name})"
end
end
InvitationsMailer.with(inviter: person_a, invitee: person_b)
.account_invitation.deliver_later
</pre>
</div>
<h4 id="direct-resolved-routes"><a class="anchorlink" href="#direct-resolved-routes">2.7 Direct & resolved routes</a></h4><p><a href="https://github.com/rails/rails/pull/23138">Pull Request</a></p><p>Rails 5.1 adds two new methods, <code>resolve</code> and <code>direct</code>, to the routing
DSL. The <code>resolve</code> method allows customizing polymorphic mapping of models.</p><div class="code_container">
<pre class="brush: ruby; gutter: false; toolbar: false">
resource :basket
resolve("Basket") { [:basket] }
</pre>
</div>
<div class="code_container">
<pre class="brush: ruby; html-script: true; gutter: false; toolbar: false">
<%= form_for @basket do |form| %>
<!-- basket form -->
<% end %>
</pre>
</div>
<p>This will generate the singular URL <code>/basket</code> instead of the usual <code>/baskets/:id</code>.</p><p>The <code>direct</code> method allows creation of custom URL helpers.</p><div class="code_container">
<pre class="brush: ruby; gutter: false; toolbar: false">
direct(:homepage) { "http://www.rubyonrails.org" }
>> homepage_url
=> "http://www.rubyonrails.org"
</pre>
</div>
<p>The return value of the block must be a valid argument for the <code>url_for</code>
method. So, you can pass a valid string URL, Hash, Array, an
Active Model instance, or an Active Model class.</p><div class="code_container">
<pre class="brush: ruby; gutter: false; toolbar: false">
direct :commentable do |model|
[ model, anchor: model.dom_id ]
end
direct :main do
{ controller: 'pages', action: 'index', subdomain: 'www' }
end
</pre>
</div>
<h4 id="unification-of-form-for-and-form-tag-into-form-with"><a class="anchorlink" href="#unification-of-form-for-and-form-tag-into-form-with">2.8 Unification of form_for and form_tag into form_with</a></h4><p><a href="https://github.com/rails/rails/pull/26976">Pull Request</a></p><p>Before Rails 5.1, there were two interfaces for handling HTML forms:
<code>form_for</code> for model instances and <code>form_tag</code> for custom URLs.</p><p>Rails 5.1 combines both of these interfaces with <code>form_with</code>, and
can generate form tags based on URLs, scopes, or models.</p><p>Using just a URL:</p><div class="code_container">
<pre class="brush: ruby; html-script: true; gutter: false; toolbar: false">
<%= form_with url: posts_path do |form| %>
<%= form.text_field :title %>
<% end %>
<%# Will generate %>
<form action="/posts" method="post" data-remote="true">
<input type="text" name="title">
</form>
</pre>
</div>
<p>Adding a scope prefixes the input field names:</p><div class="code_container">
<pre class="brush: ruby; html-script: true; gutter: false; toolbar: false">
<%= form_with scope: :post, url: posts_path do |form| %>
<%= form.text_field :title %>
<% end %>
<%# Will generate %>
<form action="/posts" method="post" data-remote="true">
<input type="text" name="post[title]">
</form>
</pre>
</div>
<p>Using a model infers both the URL and scope:</p><div class="code_container">
<pre class="brush: ruby; html-script: true; gutter: false; toolbar: false">
<%= form_with model: Post.new do |form| %>
<%= form.text_field :title %>
<% end %>
<%# Will generate %>
<form action="/posts" method="post" data-remote="true">
<input type="text" name="post[title]">
</form>
</pre>
</div>
<p>An existing model makes an update form and fills out field values:</p><div class="code_container">
<pre class="brush: ruby; html-script: true; gutter: false; toolbar: false">
<%= form_with model: Post.first do |form| %>
<%= form.text_field :title %>
<% end %>
<%# Will generate %>
<form action="/posts/1" method="post" data-remote="true">
<input type="hidden" name="_method" value="patch">
<input type="text" name="post[title]" value="<the title of the post>">
</form>
</pre>
</div>
<h3 id="incompatibilities"><a class="anchorlink" href="#incompatibilities">3 Incompatibilities</a></h3><p>The following changes may require immediate action upon upgrade.</p><h4 id="transactional-tests-with-multiple-connections"><a class="anchorlink" href="#transactional-tests-with-multiple-connections">3.1 Transactional tests with multiple connections</a></h4><p>Transactional tests now wrap all Active Record connections in database
transactions.</p><p>When a test spawns additional threads, and those threads obtain database
connections, those connections are now handled specially:</p><p>The threads will share a single connection, which is inside the managed
transaction. This ensures all threads see the database in the same
state, ignoring the outermost transaction. Previously, such additional
connections were unable to see the fixture rows, for example.</p><p>When a thread enters a nested transaction, it will temporarily obtain
exclusive use of the connection, to maintain isolation.</p><p>If your tests currently rely on obtaining a separate,
outside-of-transaction, connection in a spawned thread, you'll need to
switch to more explicit connection management.</p><p>If your tests spawn threads and those threads interact while also using
explicit database transactions, this change may introduce a deadlock.</p><p>The easy way to opt out of this new behavior is to disable transactional
tests on any test cases it affects.</p><h3 id="railties"><a class="anchorlink" href="#railties">4 Railties</a></h3><p>Please refer to the <a href="https://github.com/rails/rails/blob/5-1-stable/railties/CHANGELOG.md">Changelog</a> for detailed changes.</p><h4 id="railties-removals"><a class="anchorlink" href="#railties-removals">4.1 Removals</a></h4>
<ul>
<li><p> Remove deprecated <code>config.static_cache_control</code>.
(<a href="https://github.com/rails/rails/commit/c861decd44198f8d7d774ee6a74194d1ac1a5a13">commit</a>)</p></li>
<li><p> Remove deprecated <code>config.serve_static_files</code>.
(<a href="https://github.com/rails/rails/commit/0129ca2eeb6d5b2ea8c6e6be38eeb770fe45f1fa">commit</a>)</p></li>
<li><p> Remove deprecated file <code>rails/rack/debugger</code>.
(<a href="https://github.com/rails/rails/commit/7563bf7b46e6f04e160d664e284a33052f9804b8">commit</a>)</p></li>
<li><p> Remove deprecated tasks: <code>rails:update</code>, <code>rails:template</code>, <code>rails:template:copy</code>,
<code>rails:update:configs</code> and <code>rails:update:bin</code>.
(<a href="https://github.com/rails/rails/commit/f7782812f7e727178e4a743aa2874c078b722eef">commit</a>)</p></li>
<li><p> Remove deprecated <code>CONTROLLER</code> environment variable for <code>routes</code> task.
(<a href="https://github.com/rails/rails/commit/f9ed83321ac1d1902578a0aacdfe55d3db754219">commit</a>)</p></li>
<li><p> Remove -j (--javascript) option from <code>rails new</code> command.
(<a href="https://github.com/rails/rails/pull/28546">Pull Request</a>)</p></li>
</ul>
<h4 id="railties-notable-changes"><a class="anchorlink" href="#railties-notable-changes">4.2 Notable changes</a></h4>
<ul>
<li><p> Added a shared section to <code>config/secrets.yml</code> that will be loaded for all
environments.
(<a href="https://github.com/rails/rails/commit/e530534265d2c32b5c5f772e81cb9002dcf5e9cf">commit</a>)</p></li>
<li><p> The config file <code>config/secrets.yml</code> is now loaded in with all keys as symbols.
(<a href="https://github.com/rails/rails/pull/26929">Pull Request</a>)</p></li>
<li><p> Removed jquery-rails from default stack. rails-ujs, which is shipped
with Action View, is included as default UJS adapter.
(<a href="https://github.com/rails/rails/pull/27113">Pull Request</a>)</p></li>
<li><p> Add Yarn support in new apps with a yarn binstub and package.json.
(<a href="https://github.com/rails/rails/pull/26836">Pull Request</a>)</p></li>
<li><p> Add Webpack support in new apps via the <code>--webpack</code> option, which will delegate
to the rails/webpacker gem.
(<a href="https://github.com/rails/rails/pull/27288">Pull Request</a>)</p></li>
<li><p> Initialize Git repo when generating new app, if option <code>--skip-git</code> is not
provided.
(<a href="https://github.com/rails/rails/pull/27632">Pull Request</a>)</p></li>
<li><p> Add encrypted secrets in <code>config/secrets.yml.enc</code>.
(<a href="https://github.com/rails/rails/pull/28038">Pull Request</a>)</p></li>
<li><p> Display railtie class name in <code>rails initializers</code>.
(<a href="https://github.com/rails/rails/pull/25257">Pull Request</a>)</p></li>
</ul>
<h3 id="action-cable"><a class="anchorlink" href="#action-cable">5 Action Cable</a></h3><p>Please refer to the <a href="https://github.com/rails/rails/blob/5-1-stable/actioncable/CHANGELOG.md">Changelog</a> for detailed changes.</p><h4 id="action-cable-notable-changes"><a class="anchorlink" href="#action-cable-notable-changes">5.1 Notable changes</a></h4>
<ul>
<li><p> Added support for <code>channel_prefix</code> to Redis and evented Redis adapters
in <code>cable.yml</code> to avoid name collisions when using the same Redis server
with multiple applications.
(<a href="https://github.com/rails/rails/pull/27425">Pull Request</a>)</p></li>
<li><p> Add <code>ActiveSupport::Notifications</code> hook for broadcasting data.
(<a href="https://github.com/rails/rails/pull/24988">Pull Request</a>)</p></li>
</ul>
<h3 id="action-pack"><a class="anchorlink" href="#action-pack">6 Action Pack</a></h3><p>Please refer to the <a href="https://github.com/rails/rails/blob/5-1-stable/actionpack/CHANGELOG.md">Changelog</a> for detailed changes.</p><h4 id="action-pack-removals"><a class="anchorlink" href="#action-pack-removals">6.1 Removals</a></h4>
<ul>
<li><p> Removed support for non-keyword arguments in <code>#process</code>, <code>#get</code>, <code>#post</code>,
<code>#patch</code>, <code>#put</code>, <code>#delete</code>, and <code>#head</code> for the <code>ActionDispatch::IntegrationTest</code>
and <code>ActionController::TestCase</code> classes.
(<a href="https://github.com/rails/rails/commit/98b8309569a326910a723f521911e54994b112fb">Commit</a>,
<a href="https://github.com/rails/rails/commit/de9542acd56f60d281465a59eac11e15ca8b3323">Commit</a>)</p></li>
<li><p> Removed deprecated <code>ActionDispatch::Callbacks.to_prepare</code> and
<code>ActionDispatch::Callbacks.to_cleanup</code>.
(<a href="https://github.com/rails/rails/commit/3f2b7d60a52ffb2ad2d4fcf889c06b631db1946b">Commit</a>)</p></li>
<li><p> Removed deprecated methods related to controller filters.
(<a href="https://github.com/rails/rails/commit/d7be30e8babf5e37a891522869e7b0191b79b757">Commit</a>)</p></li>
<li><p> Removed deprecated support to <code>:text</code> and <code>:nothing</code> in <code>render</code>.
(<a href="https://github.com/rails/rails/commit/79a5ea9eadb4d43b62afacedc0706cbe88c54496">Commit</a>,
<a href="https://github.com/rails/rails/commit/57e1c99a280bdc1b324936a690350320a1cd8111">Commit</a>)</p></li>
<li><p> Removed deprecated support for calling <code>HashWithIndifferentAccess</code> methods on <code>ActionController::Parameters</code>.
(<a href="https://github.com/rails/rails/pull/26746/commits/7093ceb480ad6a0a91b511832dad4c6a86981b93">Commit</a>)</p></li>
</ul>
<h4 id="action-pack-deprecations"><a class="anchorlink" href="#action-pack-deprecations">6.2 Deprecations</a></h4>
<ul>
<li> Deprecated <code>config.action_controller.raise_on_unfiltered_parameters</code>.
It doesn't have any effect in Rails 5.1.
(<a href="https://github.com/rails/rails/commit/c6640fb62b10db26004a998d2ece98baede509e5">Commit</a>)</li>
</ul>
<h4 id="action-pack-notable-changes"><a class="anchorlink" href="#action-pack-notable-changes">6.3 Notable changes</a></h4>
<ul>
<li><p> Added the <code>direct</code> and <code>resolve</code> methods to the routing DSL.
(<a href="https://github.com/rails/rails/pull/23138">Pull Request</a>)</p></li>
<li><p> Added a new <code>ActionDispatch::SystemTestCase</code> class to write system tests in
your applications.
(<a href="https://github.com/rails/rails/pull/26703">Pull Request</a>)</p></li>
</ul>
<h3 id="action-view"><a class="anchorlink" href="#action-view">7 Action View</a></h3><p>Please refer to the <a href="https://github.com/rails/rails/blob/5-1-stable/actionview/CHANGELOG.md">Changelog</a> for detailed changes.</p><h4 id="action-view-removals"><a class="anchorlink" href="#action-view-removals">7.1 Removals</a></h4>
<ul>
<li><p> Removed deprecated <code>#original_exception</code> in <code>ActionView::Template::Error</code>.
(<a href="https://github.com/rails/rails/commit/b9ba263e5aaa151808df058f5babfed016a1879f">commit</a>)</p></li>
<li><p> Remove the option <code>encode_special_chars</code> misnomer from <code>strip_tags</code>.
(<a href="https://github.com/rails/rails/pull/28061">Pull Request</a>)</p></li>
</ul>
<h4 id="action-view-deprecations"><a class="anchorlink" href="#action-view-deprecations">7.2 Deprecations</a></h4>
<ul>
<li> Deprecated Erubis ERB handler in favor of Erubi.
(<a href="https://github.com/rails/rails/pull/27757">Pull Request</a>)</li>
</ul>
<h4 id="action-view-notable-changes"><a class="anchorlink" href="#action-view-notable-changes">7.3 Notable changes</a></h4>
<ul>
<li><p> Raw template handler (the default template handler in Rails 5) now outputs
HTML-safe strings.
(<a href="https://github.com/rails/rails/commit/1de0df86695f8fa2eeae6b8b46f9b53decfa6ec8">commit</a>)</p></li>
<li><p> Change <code>datetime_field</code> and <code>datetime_field_tag</code> to generate <code>datetime-local</code>
fields.
(<a href="https://github.com/rails/rails/pull/25469">Pull Request</a>)</p></li>
<li><p> New Builder-style syntax for HTML tags (<code>tag.div</code>, <code>tag.br</code>, etc.)
(<a href="https://github.com/rails/rails/pull/25543">Pull Request</a>)</p></li>
<li><p> Add <code>form_with</code> to unify <code>form_tag</code> and <code>form_for</code> usage.
(<a href="https://github.com/rails/rails/pull/26976">Pull Request</a>)</p></li>
<li><p> Add <code>check_parameters</code> option to <code>current_page?</code>.
(<a href="https://github.com/rails/rails/pull/27549">Pull Request</a>)</p></li>
</ul>
<h3 id="action-mailer"><a class="anchorlink" href="#action-mailer">8 Action Mailer</a></h3><p>Please refer to the <a href="https://github.com/rails/rails/blob/5-1-stable/actionmailer/CHANGELOG.md">Changelog</a> for detailed changes.</p><h4 id="action-mailer-notable-changes"><a class="anchorlink" href="#action-mailer-notable-changes">8.1 Notable changes</a></h4>
<ul>
<li><p> Allowed setting custom content type when attachments are included
and body is set inline.
(<a href="https://github.com/rails/rails/pull/27227">Pull Request</a>)</p></li>
<li><p> Allowed passing lambdas as values to the <code>default</code> method.
(<a href="https://github.com/rails/rails/commit/1cec84ad2ddd843484ed40b1eb7492063ce71baf">Commit</a>)</p></li>
<li><p> Added support for parameterized invocation of mailers to share before filters and defaults
between different mailer actions.
(<a href="https://github.com/rails/rails/commit/1cec84ad2ddd843484ed40b1eb7492063ce71baf">Commit</a>)</p></li>
<li><p> Passed the incoming arguments to the mailer action to <code>process.action_mailer</code> event under
an <code>args</code> key.
(<a href="https://github.com/rails/rails/pull/27900">Pull Request</a>)</p></li>
</ul>
<h3 id="active-record"><a class="anchorlink" href="#active-record">9 Active Record</a></h3><p>Please refer to the <a href="https://github.com/rails/rails/blob/5-1-stable/activerecord/CHANGELOG.md">Changelog</a> for detailed changes.</p><h4 id="active-record-removals"><a class="anchorlink" href="#active-record-removals">9.1 Removals</a></h4>
<ul>
<li><p> Removed support for passing arguments and block at the same time to
<code>ActiveRecord::QueryMethods#select</code>.
(<a href="https://github.com/rails/rails/commit/4fc3366d9d99a0eb19e45ad2bf38534efbf8c8ce">Commit</a>)</p></li>
<li><p> Removed deprecated <code>activerecord.errors.messages.restrict_dependent_destroy.one</code> and
<code>activerecord.errors.messages.restrict_dependent_destroy.many</code> i18n scopes.
(<a href="https://github.com/rails/rails/commit/00e3973a311">Commit</a>)</p></li>
<li><p> Removed deprecated force reload argument in singular and collection association readers.
(<a href="https://github.com/rails/rails/commit/09cac8c67af">Commit</a>)</p></li>
<li><p> Removed deprecated support for passing a column to <code>#quote</code>.
(<a href="https://github.com/rails/rails/commit/e646bad5b7c">Commit</a>)</p></li>
<li><p> Removed deprecated <code>name</code> arguments from <code>#tables</code>.
(<a href="https://github.com/rails/rails/commit/d5be101dd02214468a27b6839ffe338cfe8ef5f3">Commit</a>)</p></li>
<li><p> Removed deprecated behavior of <code>#tables</code> and <code>#table_exists?</code> to return tables and views
to return only tables and not views.
(<a href="https://github.com/rails/rails/commit/5973a984c369a63720c2ac18b71012b8347479a8">Commit</a>)</p></li>
<li><p> Removed deprecated <code>original_exception</code> argument in <code>ActiveRecord::StatementInvalid#initialize</code>
and <code>ActiveRecord::StatementInvalid#original_exception</code>.
(<a href="https://github.com/rails/rails/commit/bc6c5df4699d3f6b4a61dd12328f9e0f1bd6cf46">Commit</a>)</p></li>
<li><p> Removed deprecated support of passing a class as a value in a query.
(<a href="https://github.com/rails/rails/commit/b4664864c972463c7437ad983832d2582186e886">Commit</a>)</p></li>
<li><p> Removed deprecated support to query using commas on LIMIT.
(<a href="https://github.com/rails/rails/commit/fc3e67964753fb5166ccbd2030d7382e1976f393">Commit</a>)</p></li>
<li><p> Removed deprecated <code>conditions</code> parameter from <code>#destroy_all</code>.
(<a href="https://github.com/rails/rails/commit/d31a6d1384cd740c8518d0bf695b550d2a3a4e9b">Commit</a>)</p></li>
<li><p> Removed deprecated <code>conditions</code> parameter from <code>#delete_all</code>.
(<a href="https://github.com/rails/rails/pull/27503/commits/e7381d289e4f8751dcec9553dcb4d32153bd922b">Commit</a>)</p></li>
<li><p> Removed deprecated method <code>#load_schema_for</code> in favor of <code>#load_schema</code>.
(<a href="https://github.com/rails/rails/commit/419e06b56c3b0229f0c72d3e4cdf59d34d8e5545">Commit</a>)</p></li>
<li><p> Removed deprecated <code>#raise_in_transactional_callbacks</code> configuration.
(<a href="https://github.com/rails/rails/commit/8029f779b8a1dd9848fee0b7967c2e0849bf6e07">Commit</a>)</p></li>
<li><p> Removed deprecated <code>#use_transactional_fixtures</code> configuration.
(<a href="https://github.com/rails/rails/commit/3955218dc163f61c932ee80af525e7cd440514b3">Commit</a>)</p></li>
</ul>
<h4 id="active-record-deprecations"><a class="anchorlink" href="#active-record-deprecations">9.2 Deprecations</a></h4>
<ul>
<li><p> Deprecated <code>error_on_ignored_order_or_limit</code> flag in favor of
<code>error_on_ignored_order</code>.
(<a href="https://github.com/rails/rails/commit/451437c6f57e66cc7586ec966e530493927098c7">Commit</a>)</p></li>
<li><p> Deprecated <code>sanitize_conditions</code> in favor of <code>sanitize_sql</code>.
(<a href="https://github.com/rails/rails/pull/25999">Pull Request</a>)</p></li>
<li><p> Deprecated <code>supports_migrations?</code> on connection adapters.
(<a href="https://github.com/rails/rails/pull/28172">Pull Request</a>)</p></li>
<li><p> Deprecated <code>Migrator.schema_migrations_table_name</code>, use <code>SchemaMigration.table_name</code> instead.
(<a href="https://github.com/rails/rails/pull/28351">Pull Request</a>)</p></li>
<li><p> Deprecated using <code>#quoted_id</code> in quoting and type casting.
(<a href="https://github.com/rails/rails/pull/27962">Pull Request</a>)</p></li>
<li><p> Deprecated passing <code>default</code> argument to <code>#index_name_exists?</code>.
(<a href="https://github.com/rails/rails/pull/26930">Pull Request</a>)</p></li>
</ul>
<h4 id="active-record-notable-changes"><a class="anchorlink" href="#active-record-notable-changes">9.3 Notable changes</a></h4>
<ul>
<li><p> Change Default Primary Keys to BIGINT.
(<a href="https://github.com/rails/rails/pull/26266">Pull Request</a>)</p></li>
<li><p> Virtual/generated column support for MySQL 5.7.5+ and MariaDB 5.2.0+.
(<a href="https://github.com/rails/rails/commit/65bf1c60053e727835e06392d27a2fb49665484c">Commit</a>)</p></li>
<li><p> Added support for limits in batch processing.
(<a href="https://github.com/rails/rails/commit/451437c6f57e66cc7586ec966e530493927098c7">Commit</a>)</p></li>
<li><p> Transactional tests now wrap all Active Record connections in database
transactions.
(<a href="https://github.com/rails/rails/pull/28726">Pull Request</a>)</p></li>
<li><p> Skipped comments in the output of <code>mysqldump</code> command by default.
(<a href="https://github.com/rails/rails/pull/23301">Pull Request</a>)</p></li>
<li><p> Fixed <code>ActiveRecord::Relation#count</code> to use Ruby's <code>Enumerable#count</code> for counting
records when a block is passed as argument instead of silently ignoring the
passed block.
(<a href="https://github.com/rails/rails/pull/24203">Pull Request</a>)</p></li>
<li><p> Pass <code>"-v ON_ERROR_STOP=1"</code> flag with <code>psql</code> command to not suppress SQL errors.
(<a href="https://github.com/rails/rails/pull/24773">Pull Request</a>)</p></li>
<li><p> Add <code>ActiveRecord::Base.connection_pool.stat</code>.
(<a href="https://github.com/rails/rails/pull/26988">Pull Request</a>)</p></li>
<li><p> Inheriting directly from <code>ActiveRecord::Migration</code> raises an error.
Specify the Rails version for which the migration was written for.
(<a href="https://github.com/rails/rails/commit/249f71a22ab21c03915da5606a063d321f04d4d3">Commit</a>)</p></li>
<li><p> An error is raised when <code>through</code> association has ambiguous reflection name.
(<a href="https://github.com/rails/rails/commit/0944182ad7ed70d99b078b22426cbf844edd3f61">Commit</a>)</p></li>
</ul>
<h3 id="active-model"><a class="anchorlink" href="#active-model">10 Active Model</a></h3><p>Please refer to the <a href="https://github.com/rails/rails/blob/5-1-stable/activemodel/CHANGELOG.md">Changelog</a> for detailed changes.</p><h4 id="active-model-removals"><a class="anchorlink" href="#active-model-removals">10.1 Removals</a></h4>
<ul>
<li><p> Removed deprecated methods in <code>ActiveModel::Errors</code>.
(<a href="https://github.com/rails/rails/commit/9de6457ab0767ebab7f2c8bc583420fda072e2bd">commit</a>)</p></li>
<li><p> Removed deprecated <code>:tokenizer</code> option in the length validator.
(<a href="https://github.com/rails/rails/commit/6a78e0ecd6122a6b1be9a95e6c4e21e10e429513">commit</a>)</p></li>
<li><p> Remove deprecated behavior that halts callbacks when the return value is false.
(<a href="https://github.com/rails/rails/commit/3a25cdca3e0d29ee2040931d0cb6c275d612dffe">commit</a>)</p></li>
</ul>
<h4 id="active-model-notable-changes"><a class="anchorlink" href="#active-model-notable-changes">10.2 Notable changes</a></h4>
<ul>
<li> The original string assigned to a model attribute is no longer incorrectly
frozen.
(<a href="https://github.com/rails/rails/pull/28729">Pull Request</a>)</li>
</ul>
<h3 id="active-job"><a class="anchorlink" href="#active-job">11 Active Job</a></h3><p>Please refer to the <a href="https://github.com/rails/rails/blob/5-1-stable/activejob/CHANGELOG.md">Changelog</a> for detailed changes.</p><h4 id="active-job-removals"><a class="anchorlink" href="#active-job-removals">11.1 Removals</a></h4>
<ul>
<li><p> Removed deprecated support to passing the adapter class to <code>.queue_adapter</code>.
(<a href="https://github.com/rails/rails/commit/d1fc0a5eb286600abf8505516897b96c2f1ef3f6">commit</a>)</p></li>
<li><p> Removed deprecated <code>#original_exception</code> in <code>ActiveJob::DeserializationError</code>.
(<a href="https://github.com/rails/rails/commit/d861a1fcf8401a173876489d8cee1ede1cecde3b">commit</a>)</p></li>
</ul>
<h4 id="active-job-notable-changes"><a class="anchorlink" href="#active-job-notable-changes">11.2 Notable changes</a></h4>
<ul>
<li><p> Added declarative exception handling via <code>ActiveJob::Base.retry_on</code> and <code>ActiveJob::Base.discard_on</code>.
(<a href="https://github.com/rails/rails/pull/25991">Pull Request</a>)</p></li>
<li><p> Yield the job instance so you have access to things like <code>job.arguments</code> on
the custom logic after retries fail.
(<a href="https://github.com/rails/rails/commit/a1e4c197cb12fef66530a2edfaeda75566088d1f">commit</a>)</p></li>
</ul>
<h3 id="active-support"><a class="anchorlink" href="#active-support">12 Active Support</a></h3><p>Please refer to the <a href="https://github.com/rails/rails/blob/5-1-stable/activesupport/CHANGELOG.md">Changelog</a> for detailed changes.</p><h4 id="removals"><a class="anchorlink" href="#removals">12.1 Removals</a></h4>
<ul>
<li><p> Removed the <code>ActiveSupport::Concurrency::Latch</code> class.
(<a href="https://github.com/rails/rails/commit/0d7bd2031b4054fbdeab0a00dd58b1b08fb7fea6">Commit</a>)</p></li>
<li><p> Removed <code>halt_callback_chains_on_return_false</code>.
(<a href="https://github.com/rails/rails/commit/4e63ce53fc25c3bc15c5ebf54bab54fa847ee02a">Commit</a>)</p></li>
<li><p> Removed deprecated behavior that halts callbacks when the return is false.
(<a href="https://github.com/rails/rails/commit/3a25cdca3e0d29ee2040931d0cb6c275d612dffe">Commit</a>)</p></li>
</ul>
<h4 id="active-support-deprecations"><a class="anchorlink" href="#active-support-deprecations">12.2 Deprecations</a></h4>
<ul>
<li><p> The top level <code>HashWithIndifferentAccess</code> class has been softly deprecated
in favor of the <code>ActiveSupport::HashWithIndifferentAccess</code> one.
(<a href="https://github.com/rails/rails/pull/28157">Pull Request</a>)</p></li>
<li><p> Deprecated passing string to <code>:if</code> and <code>:unless</code> conditional options on <code>set_callback</code> and <code>skip_callback</code>.
(<a href="https://github.com/rails/rails/commit/0952552">Commit</a>)</p></li>
</ul>
<h4 id="notable-changes"><a class="anchorlink" href="#notable-changes">12.3 Notable changes</a></h4>
<ul>
<li><p> Fixed duration parsing and traveling to make it consistent across DST changes.
(<a href="https://github.com/rails/rails/commit/8931916f4a1c1d8e70c06063ba63928c5c7eab1e">Commit</a>,
<a href="https://github.com/rails/rails/pull/26597">Pull Request</a>)</p></li>
<li><p> Updated Unicode to version 9.0.0.
(<a href="https://github.com/rails/rails/pull/27822">Pull Request</a>)</p></li>
<li><p> Add Duration#before and #after as aliases for #ago and #since.
(<a href="https://github.com/rails/rails/pull/27721">Pull Request</a>)</p></li>
<li><p> Added <code>Module#delegate_missing_to</code> to delegate method calls not
defined for the current object to a proxy object.
(<a href="https://github.com/rails/rails/pull/23930">Pull Request</a>)</p></li>
<li><p> Added <code>Date#all_day</code> which returns a range representing the whole day
of the current date & time.
(<a href="https://github.com/rails/rails/pull/24930">Pull Request</a>)</p></li>
<li><p> Introduced the <code>assert_changes</code> and <code>assert_no_changes</code> methods for tests.
(<a href="https://github.com/rails/rails/pull/25393">Pull Request</a>)</p></li>
<li><p> The <code>travel</code> and <code>travel_to</code> methods now raise on nested calls.
(<a href="https://github.com/rails/rails/pull/24890">Pull Request</a>)</p></li>
<li><p> Update <code>DateTime#change</code> to support usec and nsec.
(<a href="https://github.com/rails/rails/pull/28242">Pull Request</a>)</p></li>
</ul>
<h3 id="credits"><a class="anchorlink" href="#credits">13 Credits</a></h3><p>See the
<a href="https://contributors.rubyonrails.org/">full list of contributors to Rails</a> for
the many people who spent many hours making Rails, the stable and robust
framework it is. Kudos to all of them.</p>
<h3>피드백</h3>
<p>
이 가이드의 품질을 향상시키기 위해 여러분의 도움이 필요하다.
</p>
<p>
오타나 실제 오류를 발견시 여러분의 기여를 권고한다. 시작하려면 본 <a href="https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#contributing-to-the-rails-documentation">가이드의 기여</a> 섹션을 읽어보기 바란다.
</p>
<p>
미완성된 컨텐츠나 업데이트되지 않은 내용을 발견할 수도 있다. 누락된 문서는 master 브랜치에 추가한다. 제시된 이슈들이 master 브랜치 상에서 이미 해결되었는지 여부를 확인하려면 먼저 <a href="https://edgeguides.rubyonrails.org">Edge Guides</a>를 확인한다. 스타일과 규칙에 대해서는 <a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</a>을 확인한다.
</p>
<p>
어떤 이유로든 고칠 수 있지만 직접 패치 할 수 없는 경우 <a href="https://github.com/rails/rails/issues">이슈를 새로 오픈</a>하면 된다.
</p>
<p>
그리고 마지막으로, 루비온레일스 문서에 관한 모든 논의는 <a href="https://groups.google.com/forum/#!forum/rubyonrails-docs">rubyonrails-docs 메일링 리스트</a> 상에서 언제든지 가능하다.
</p>
</div>
</div>
</div>
<hr class="hide" />
<div id="footer">
<div class="wrapper">
<p>본 결과물은 <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a> 를 준수한다. </p>
<p>"Rails", "Ruby on Rails", 그리고 레일스 로고는 David Heinemeier Hansson의 등록상표이다. 판권 소유.</p>
</div>
</div>
</body>
</html>