> For the complete documentation index, see [llms.txt](https://cometkim.gitbook.io/rails-study-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cometkim.gitbook.io/rails-study-notes/releases/5.2.md).

# 5.2

원본: http\://guides.rubyonrails.org/5\_2\_release\_notes.html

## Ruby on Rails 5.2 릴리즈 노트

레일즈 5.2 하이라이트:

* Active Storage
* Redis 캐시 저장소
* HTTP/2 초기 힌트
* Credentials
* Content Security Policy

이 릴리즈 노트에는 주요 변경점만 포함됩니다. 더 다양한 변경점과 버그 수정을 보려면 GitHub에서 Rails 메인 저장소의 [커밋 목록](https://github.com/rails/rails/commits/5-2-stable)이나 변경 로그를 확인하세요.

## 레일즈 5.2로 업그레이드하기

기존 애플리케이션을 업그레이드하기 전에 충분한 테스트 커버리지를 확보하는 것이 좋습니다. 애플리케이션이 레일즈 5.1로 업그레이드하지 않았다면 우선 업그레이드하고, 애플리케이션이 정상적으로 동작하는지 충분히 확인한 뒤에 레일즈 5.2로 올려주세요. 업그레이드 시 주의점에 대해서는 [Ruby on Rails 업그레이드 가이드](http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-5-1-to-rails-5-2)를 참고해주세요.

## 주요 변경점

### Active Storage

[Pull Request](https://github.com/rails/rails/pull/30020)

[액티브 스토리지](https://github.com/rails/rails/tree/5-2-stable/activestorage)는 Amozon S3, Google Cloud Storage, Microsoft Azure Storage 같은 클라우드 스토리지 서비스에 파일을 업로드하고 액티브 레코드 객체에 첨부하는 작업을 용이하게 합니다. 개발 및 테스트 용으로 로컬 디스크 기반 서비스가 함께 제공되고, 백업과 마이그레이션을 위해 다른 서비스로 미러링 할 수도 있습니다.  액티브 스토리지에 대한 더 자세한 내용은 [Active Storage Overview](http://guides.rubyonrails.org/active_storage_overview.html) 가이드를 참고하세요.

### Redis 캐시 저장소

[Pull Request](https://github.com/rails/rails/pull/31134)

레일즈 5.2부터 Redis 캐시 저장소가 내장됩니다. 자세한 내용은 [Caching with Rails: An Overview](http://guides.rubyonrails.org/caching_with_rails.html#activesupport-cache-rediscachestore) 가이드를 참고하세요.

### HTTP/2 초기 힌트

[Pull Request](https://github.com/rails/rails/pull/30744)

레일즈 5.2부터 HTTP/2 초기 힌트를 지원합니다. 초기 힌트를 활성화하려면 서버 시작 시 `--early-hints` 플래그를 사용하세요.

### Credentials

[Pull Request](https://github.com/rails/rails/pull/30067)

프로덕션 앱 보안을 위한 `config/credentials.yml.enc` 파일이 추가되었습니다. 서드파티 서비스의 인증 정보가 `config/master.key` 파일 또는 `RAILS_MASTER_KEY` 환경변수로 암호화되어 레파지토리에 직접 저장할 수 있습니다. 이 기능은 레일즈 5.1에서 소개했던 `Rails.application.secrets`를 대체합니다. 또한, 레일즈 5.2 추가된 [API를 통해 암호화된 커스텀 설정, 키, 파일 등을 쉽게 처리](https://github.com/rails/rails/pull/30940)할 수 있습니다. 더 자세한 내용은 [Securing Rails Application](http://guides.rubyonrails.org/security.html#custom-credentials) 가이드를 참고하세요.

### Content Security Policy

[Pull Request](https://github.com/rails/rails/pull/31162)

레일즈 5.2는 [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) 설정을 위한 새로운 DSL이 추가되었습니다. 전역 기본 정책을 설정하고 리소스 별로 정책을 오버라이드해서 사용할 수 있으며 람다 문법을 이용해서 계정 별 서브도메인 같은 요청 별 값을 헤더에 넣을 수도 있습니다. 더 자세한 내용은 [Securing Rails Application](http://guides.rubyonrails.org/security.html#content-security-policy) 가이드를 참고하세요.

## Railties

자세한 변경사항은 [변경로그](https://github.com/rails/rails/blob/5-2-stable/railties/CHANGELOG.md)를 참고하세요.

### Deprecations

* 제너레이터와 템플릿의 `capify!` 메서드가 Deprecated 되었습니다. ([Pull Request](https://github.com/rails/rails/pull/29493))
* `rails dbconsole`, `rails console` 커맨드에 환경변수 이름을 매개변수로 전달하는 기능이 Deprecated 되었습니다. `-e` 옵션을 사용하세요. ([Commit](https://github.com/rails/rails/commit/48b249927375465a7102acc71c2dfb8d49af8309))
* 레일즈 서버를 실행하기 위해 `Rails::Application`의 서브클래스를 사용하는 것이 Deprecated 되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30127))
* 레일즈 플러그인 템플릿의 `after_bundle` 콜백이 Deprecated 되었습니다. ([Pull Request](https://github.com/rails/rails/pull/29446))

### 주요 변경점

* `config/database.yml` 파일에 모든 환경에서 로드되는 `shared` 섹션이 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/28896))
* 플러그인 제너레이터에 `railtie.rb` 파일이 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/29576))
* `tmp:clear` 작업 시 스크린샷 파일들이 제거됩니다. ([Pull Request](https://github.com/rails/rails/pull/29534))
* `bin/rails app:update` 실행 시 사용하지 않는 컴포넌트가 생략됩니다. 초기 앱 생성 시 액션 케이블, 액티브 레코드 등을 생략했다면 업데이트 작업에서도 생략됩니다. ([Pull Request](https://github.com/rails/rails/pull/29645))
* 3-레벨 데이터베이스 구성 사용 시 `rails dbconsole` 커맨드에 커스텀 연결 이름을 전달 할 수 있습니다. 예시: `bin/rails dbconsole -c replica`. ([Commit](https://github.com/rails/rails/commit/1acd9a6464668d4d54ab30d016829f60b70dbbeb))
* `bootsnap` 잼이 `Gemfile` 파일에 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/29313))
* 새 레일즈 앱을 생성할 때 현재 루비 버전을 `ruby x.x.x` 디렉티브로 `Gemfile`에 추가하고 `.ruby-version` 파일을 생성합니다.  ([Pull Request](https://github.com/rails/rails/pull/30016))
* 플러그인 제너레이터에 `--skip-action-cable` 옵션이 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30164))
* 플러그인 제너레이터에서 `git_source` 디렉티브가 `Gemfile`에 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30110))
* `bin/rails` 실행 시 사용하지 않는 컴포넌트가 생략됩니다. ([Commit](https://github.com/rails/rails/commit/62499cb6e088c3bc32a9396322c7473a17a28640))
* 제너레이터 액션의 들여쓰기 동작이 최적화되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30166))
* 라우트 생성 시 네임스페이스 들여쓰기 동작이 최적화되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30241))
* 플러그인 제너레이터에 `--skip-yarn` 옵션이 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30238))
* 제너레이터의 `gem` 메서드에 여러 버전 매개변수가 지원됩니다. ([Pull Request](https://github.com/rails/rails/pull/30323))
* 개발과 테스트 환경에서 `secret_key_base` 값이 앱 이름으로부터 자동으로 파생됩니다. ([Pull Request](https://github.com/rails/rails/pull/30067))
* `mini_magick` 잼이 `Gemfile` 파일에 주석으로 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30067))
* `rails new`와 `rails plugin new`에 액티브 스토리지 기능이 기본적으로 추가됩니다. `--skip-active-storage` 옵션으로 생략할 수 있고, `--skip-active-record` 옵션이 사용되면 자동적으로 함께 생략됩니다. ([Pull Request](https://github.com/rails/rails/pull/30101))

## Action Cable

자세한 변경사항은 [변경로그](https://github.com/rails/rails/blob/5-2-stable/actioncable/CHANGELOG.md)를 참고하세요.

### 제거된 것

* 이벤트 레디스 어댑터가 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/48766e32d31651606b9f68a16015ad05c3b0de2c))

### 주요 변경점

* `cable.yml` 파일에 `host`, `port`, `db`, `password`  옵션이 지원됩니다. ([Pull Request](https://github.com/rails/rails/pull/29528))
* PostgreSQL 어댑터 사용 시 긴 스트림 식별자를 해시해서 사용합니다. ([Pull Request](https://github.com/rails/rails/pull/29297))

## Action Pack

자세한 변경사항은 [변경로그](https://github.com/rails/rails/blob/5-2-stable/actionpack/CHANGELOG.md)를 참고하세요.

### 제거된 것

* `ActiveController::ParamsParser::ParseError`가 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/e16c765ac6dcff068ff2e5554d69ff345c003de1))

### Deprecations

* `ActionDispatch::TestReponse`에서 `#success?`, `#missing?`, `#error?`가 Deprecated 되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30104))

### 주요 변경점

* 프래그먼트 캐시에 재활용 가능한 캐시 키가 제공됩니다. ([Pull Request](https://github.com/rails/rails/pull/29092))
* 키 변경을 쉽게 디버그하기 위해 프래그먼트에 대한 캐시 키 포맷이 변경되었습니다. ([Pull Request](https://github.com/rails/rails/pull/29092))
* 쿠키 암호화를 AEAD 변경하고, 세션에 GCM을 사용합니다.  ([Pull Request](https://github.com/rails/rails/pull/28132))
* 폼 위변조 방지를 기본으로 적용합니다. ([Pull Request](https://github.com/rails/rails/pull/29742))
* 서버 측에서 인증/암호화된 쿠키의 만료기간을 강제합니다. ([Pull Request](https://github.com/rails/rails/pull/30121))
* 쿠키의 `:expires` 옵션이 `ActiveSupport::Duration` 객체를 지원합니다. ([Pull Request](https://github.com/rails/rails/pull/30121))
* Capybara에 등록된 `:puma` 서버 설정을 사용합니다. ([Pull Request](https://github.com/rails/rails/pull/30638))
* 쿠키 미들웨어에 키 로테이션 기능을 추가하고 단순화시켰습니다. ([Pull Request](https://github.com/rails/rails/pull/29716))
* HTTP/2 초기 힌트 기능을 활성화 할 수 있습니다. ([Pull Request](https://github.com/rails/rails/pull/30744))
* 시스템 테스트에서 헤드리스 크롬을 사용할 수 있습니다. ([Pull Request](https://github.com/rails/rails/pull/30876))
* `redirect_back` 메서드에 `:allow_other_host` 옵션이 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30850))
* `assert_recognizes` 메서드가 마운트된 엔진을 통과하도록 했습니다. ([Pull Request](https://github.com/rails/rails/pull/22435))
* Content-Security-Policy 헤더를 설정하기 위한 DSL이 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/31162))
* 모던 브라우저에서 지원되는 유명한 오디오/비디오/폰트의 MIME 타입들이 등록되었습니다. ([Pull Request](https://github.com/rails/rails/pull/31251))
* 기본 시스템 테스트 스크린샷 출력을 `inline`에서 `simple`로 변경하였습니다. ([Commit](https://github.com/rails/rails/commit/9d6e288ee96d6241f864dbf90211c37b14a57632))
* 시스템 테스트에서 헤드리스 파이어폭스를 사용할 수 있습니다. ([Pull Request](https://github.com/rails/rails/pull/31365))
* 보안을 위해 `X-Download-Options`, `X-Permitted-Cross-Domain-Policies` 헤더를 기본 헤더 집합에 추가하였습니다. ([Commit](https://github.com/rails/rails/commit/5d7b70f4336d42eabfc403e9f6efceb88b3eff44))
* 시스템 테스트에서 사용자가 다른 서버를 직접 지정하지 않은 경우에만 Puma를 기본 서버로 사용하도록 변경했습니다. ([Pull Request](https://github.com/rails/rails/pull/31384))
* `Referrer-Policy` 헤더를 기본 헤더 집합에 추가하였습니다. ([Commit](https://github.com/rails/rails/commit/428939be9f954d39b0c41bc53d85d0d106b9d1a1))
* `ActionController::Parameters#each` 동작이 `Hash#each` 동작과 일치하도록 수정했습니다. ([Pull Request](https://github.com/rails/rails/pull/27790))
* Rails UJS에 자동 암호화 토큰(Nonce) 생성 기능이 추가되었습니다. ([Commit](https://github.com/rails/rails/commit/b2f0a8945956cd92dec71ec4e44715d764990a49))
* <https://hstspreload.org/> 요구사항을 충족하기 위해 기본 HSTS max-age 값을 31536000초(1년) 으로 수정했습니다. ([Commit](https://github.com/rails/rails/commit/30b5f469a1d30c60d1fb0605e84c50568ff7ed37))
* `cookies`, `session` 객체에 각각 `to_hash` 메서드의 별칭인 `to_h` 메서드를 추가했습니다. ([Commit](https://github.com/rails/rails/commit/50a62499e41dfffc2903d468e8b47acebaf9b500))

## Action View

자세한 변경사항은 [변경로그](https://github.com/rails/rails/blob/5-2-stable/actionview/CHANGELOG.md)를 참고하세요.

### 제거된 것

* Erubis ERB 처리기가 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/7de7f12fd140a60134defe7dc55b5a20b2372d06))

### Deprecations

* `image_tag` 뷰 헬퍼가 자동으로 생성하는 이미지의 대체 텍스트와 여기에 사용되는 `image_alt` 뷰 헬퍼가 Deprecated 되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30213))

### 주요 변경점

* [JSON 피드](https://jsonfeed.org/version/1)를 지원하기 위해 `auto_discovery_link_tag` 뷰 헬퍼에 `:json` 타입이 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/29158))
* `image_tag` 뷰 헬퍼에 `srcset` 옵션이 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/29349))
* `field_error_proc`가 `optgroup`, `select` 태그를 둘 다 감싸는 문제를 수정했습니다. ([Pull Request](https://github.com/rails/rails/pull/31088))
* `form_with` 뷰 헬퍼가 기본적으로 ID를 생성하도록 변경했습니다. ([Commit](https://github.com/rails/rails/commit/260d6f112a0ffdbe03e6f5051504cb441c1e94cd))
* `preload_link_tag` 뷰 헬퍼가 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/31251))
* `option_groups_from_collection_for_select` 헬퍼에 호출가능한 객체를 사용할 수 있도록 변경했습니다. ([Pull Request](https://github.com/rails/rails/pull/31578))

## Action Mailer

자세한 변경사항은 [변경로그](https://github.com/rails/rails/blob/5-2-stable/actionmailer/CHANGELOG.md)를 참고하세요.

### 주요 변경점

* 액션 메일러 클래스에서 직접 딜리버리 잡을 구성할 수 있습니다. ([Pull Request](https://github.com/rails/rails/pull/29457))
* `assert_enqueued_email_with` 테스트 헬퍼가 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30695))

## Active Record

자세한 변경사항은 [변경로그](https://github.com/rails/rails/blob/5-2-stable/activerecord/CHANGELOG.md)를 참고하세요.

### 제거된 것

* `#migration_keys` 메서드가 제거되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30337))
* 액티브 레코드 객체를 형변환 할 때 `quoted_id`를 더 이상 지원하지 않습니다. ([Commit](https://github.com/rails/rails/commit/82472b3922bda2f337a79cef961b4760d04f9689))
* `index_name_exists?` 메서드에 `default` 매개변수가 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/e65aff70696be52b46ebe57207ebd8bb2cfcdbb6))
* 관계 정의 시 `:class_name` 속성에 클래스를 전달할 수 없도록 변경되었습니다. ([Commit](https://github.com/rails/rails/commit/e65aff70696be52b46ebe57207ebd8bb2cfcdbb6))
* `initialize_schema_migrations_table`, `initialize_internal_metadata_table` 메서드가 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/c9660b5777707658c414b430753029cd9bc39934))
* `supports_migrations?` 메서드가 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/9438c144b1893f2a59ec0924afe4d46bd8d5ffdd))
* `supports_primary_key?` 메서드가 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/c56ff22fc6e97df4656ddc22909d9bf8b0c2cbb1))
* `ActiveRecord::Migrator.schema_migrations_tabile_name` 메서드가 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/7df6e3f3cbdea9a0460ddbab445c81fbb1cfd012))
* `#indexes` 메서드에서 Deprecated 되었던 매개변수들이 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/d6b779ecebe57f6629352c34bfd6c442ac8fba0e))
* `#verify!` 메서드에서 Deprecated 되었던 매개변수들이 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/9c6ee1bed0292fc32c23dc1c68951ae64fc510be))
* `.error_on_ignored_order_or_limit` 설정이 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/e1066f450d1a99c9a0b4d786b202e2ca82a4c3b3))
* `#scope_chain` 메서드가 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/ef7784752c5c5efbe23f62d2bbcc62d4fd8aacab))
* `#sanitize_conditions` 메서드가 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/8f5413b896099f80ef46a97819fe47a820417bc2))

### Deprecations

* `supports_statement_cache?` 메서드가 Deprecated 되었습니다. ([Pull Request](https://github.com/rails/rails/pull/28938))
* `ActiveRecord::Calculations` 객체의 `count`, `sum` 메서드에 매개변수와 블럭을 함께 전달할 수 없게 되습니다. ([Pull Request](https://github.com/rails/rails/pull/29262))
* `Relation` 객체의 `arel` 델리게이션이 Deprecated 되었습니다. ([Pull Request](https://github.com/rails/rails/pull/29619))
* `TransactionState` 객체의 `set_state` 메서드가 Deprecated 되었습니다. ([Commit](https://github.com/rails/rails/commit/608ebccf8f6314c945444b400a37c2d07f21b253))
* `expand_hash_conditions_for_aggregates` 메서드가 Deprecated 되었습니다. ([Commit](https://github.com/rails/rails/commit/7ae26885d96daee3809d0bd50b1a440c2f5ffb69))

### 주요 변경점

* 동적 픽스쳐 접근자를 인자없이 호출하면 빈 배열을 반환하는 대신 해당하는 타입의 모든 픽스쳐를 반환합니다. ([Pull Request](https://github.com/rails/rails/pull/28692))
* 액티브 레코드의 어트리뷰트 리더를 오버라이딩 할 때 변경되는 어트리뷰트가 불일치 하는 문제를 수정했습니다. ([Pull Request](https://github.com/rails/rails/pull/28661))
* MySQL의 내림차순 인덱스가 지원됩니다. ([Pull Request](https://github.com/rails/rails/pull/28773))
* `bin/rails db:forward` 명령어가 올바르게 동작하도록 수정했습니다. ([Commit](https://github.com/rails/rails/commit/b77d2aa0c336492ba33cbfade4964ba0eda3ef84))
* 마이그레이션 변경 시 현재 마이그레이션이 존재하지 않으면  `UnknownMigrationVersionError` 에러가 발생합니다. ([Commit](https://github.com/rails/rails/commit/bb9d6eb094f29bb94ef1f26aa44f145f17b973fe))
* 데이터베이스 구조 덤프 작업 시 `SchemaDumper.ignore_tables` 값이 적용되도록 수정했습니다. ([Pull Request](https://github.com/rails/rails/pull/29077))
* &#x20;`ActiveSupport::Cache`의 버전이 적용된 항목들을 통해 재활용 가능한 캐시 키를 지원하는 `ActiveRecord::Base#cache_version`가 추가됐습니다. 이제 `ActiveRecord::Base#cache_key`가 타임스탬프를 사용하지 않고 더 안정적인 키를 반환합니다. ([Pull Request](https://github.com/rails/rails/pull/29092))
* 형변환 된 값이 `nil`인 경우 파라미터가 바인딩되지 않도록 막습니다. ([Pull Request](https://github.com/rails/rails/pull/29282))
* 픽스쳐 삽입 시 더 나은 성능을 위해 일괄(Bulk) `INSERT` 구문을 사용합니다. ([Pull Request](https://github.com/rails/rails/pull/29504))
* 두 중첩 조인 관계를 병합할 때 더 이상 `LEFT OUTER JOIN` 구문으로 변환되지 않습니다. ([Pull Request](https://github.com/rails/rails/pull/27063))
* 부모 트랜잭션을 롤백할 때 부모 트랜잭션의 상태를 자식 트랜잭션에도 반영하도록 수정했습니다. 이전에는 중첩 트랜잭션이나 외부 트랜잭션을 롤백해도 내부 트랜잭션의 레코드가 계속 지속적(persisted)인 것으로 인식했습니다. ([Commit](https://github.com/rails/rails/commit/0237da287eb4c507d10a0c6d94150093acc52b03))
* 조인 스코프를 포함하는 Pre/Eager 로딩 관계를 수정했습니다. ([Pull Request](https://github.com/rails/rails/pull/29413))
* `sql.active_record` 알림 구독자가 발생시키는 에러가 `ActiveRecord::StatementInvalid` 예외로 변환되지 않도록 수정했습니다. ([Pull Request](https://github.com/rails/rails/pull/29692))
* `find_each`, `find_in_batches`, `in_batches` 메서드로 작업할 때 쿼리 캐싱이 생략됩니다. ([Commit](https://github.com/rails/rails/commit/b83852e6eed5789b23b13bac40228e87e8822b4d))
* SQLite3의 boolean 시리얼라이저가 1과 0을 사용하도록 변경했습니다. SQLite는 1과 0을 논리값으로 식별하는 것을 기본적으로 지원하지만, 이전의 't'와 'f'는 지원되지 않습니다. ([Pull Request](https://github.com/rails/rails/pull/29699))
* 다중 매개변수로 할당된 속성을 폼에서 단일 필드 입력으로 사용할 수 있습니다. ([Commit](https://github.com/rails/rails/commit/1519e976b224871c7f7dd476351930d5d0d7faf6))
* `ApplicationRecord`가 더 이상 모델을 생성하지 않습니다. 생성하려면 `rails g application_record` 명령어를 사용하세요. ([Pull Request](https://github.com/rails/rails/pull/29916))
* `Relation#or` 메서드가 서로 다른 `references` 값을 사용하는 경우를 허용합니다. ([Commit](https://github.com/rails/rails/commit/ea6139101ccaf8be03b536b1293a9f36bc12f2f7))&#x20;
* `Relation#or` 메서드를 사용할 때 일반적인 조건들을 추출해서 OR 조건 이전에 삽입합니다. ([Pull Request](https://github.com/rails/rails/pull/29950))
* `binary` 픽스쳐 헬퍼 메서드가 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30073))
* STI의 inverse 관계가 자동으로 추론됩니다. ([Pull Request](https://github.com/rails/rails/pull/23425))
* `LockWaitTimeout` 에러 클래스를 추가했습니다. ([Pull Request](https://github.com/rails/rails/pull/30360))
* `sql.active_record` 인스트루먼테이션의 페이로드 이름이 더 자세한 내용을 나타내도록 수정했습니다. ([Pull Request](https://github.com/rails/rails/pull/30619))
* 데이터베이스의 인덱스를 삭제할 때 전달된 알고리즘을 사용합니다. ([Pull Request](https://github.com/rails/rails/pull/24199))
* `Relation#where` 메서드에 `Set`을 전달하는 것이  이제 배열을 전달하는 것 과 동일하게 동작합니다. ([Commit](https://github.com/rails/rails/commit/9cf7e3494f5bd34f1382c1ff4ea3d811a4972ae2))
* PostgreSQL `tsrange` 형식이 이제 1초 미만의 정밀도를 유지합니다. ([Pull Request](https://github.com/rails/rails/pull/30725))
* Dirty 레코드에서 `lock!` 메서드를 호출하면 에러를 발생시킵니다. ([Commit](https://github.com/rails/rails/commit/63cf15877bae859ff7b4ebaf05186f3ca79c1863))
* SQLite 어댑터를 사용할 때 인덱스의 열 순서가 `db/schema.rb` 파일에 기록되지 않는 버그를 수정했습니다. ([Pull Request](https://github.com/rails/rails/pull/30970))
* `bin/rails db:migrate` 명령어에 `VERSION` 값을 지정합니다. `VERSION` 값이 비어있으면 버전을 지정하지 않은 것처럼 동작합니다. `VERSION` 값에는 마이그레이션 버전 넘버나 마이그레이션 파일명을 사용할 수 있습니다. 값의 형식이 올바르지 않거나 해당하는 마이그레이션이 존재하지 않는 경우 에러가 발생합니다.
* `StatementTimeout` 에러 클래스를 추가했습니다. ([Pull Request](https://github.com/rails/rails/pull/31129))
* `update_all` 메서드가 이제 `Type#serialize` 메서드에 값들을 전달하기 전에 `Type#cast` 메서드에 먼저 전달합니다. 따라서 `update_all(foo: 'true')`처럼 사용할 때 올바르게 boolean 타입으로 처리됩니다. ([Commit](https://github.com/rails/rails/commit/68fe6b08ee72cc47263e0d2c9ff07f75c4b42761))
* 관계형 쿼리 메서드에서 원시 SQL을 사용할 때 명시적인 표현을 위해 SQL 프래그먼트가 요구됩니다. ([Commit](https://github.com/rails/rails/commit/a1ee43d2170dd6adf5a9f390df2b1dde45018a48), [Commit](https://github.com/rails/rails/commit/e4a921a75f8702a7dbaf41e31130fe884dea93f9))
* 데이터베이스 마이그레이션에서 업그레이드에만 관련된 코드를 위해 `#up_only` 메서드를 추가했습니다. ([Pull Request](https://github.com/rails/rails/pull/31082))
* Add new error class `QueryCanceled` which will be raised when canceling statement due to user request. ([Pull Request](https://github.com/rails/rails/pull/31235))
* Don't allow scopes to be defined which conflict with instance methods on `Relation`. ([Pull Request](https://github.com/rails/rails/pull/31179))
* Add support for PostgreSQL operator classes to `add_index`. ([Pull Request](https://github.com/rails/rails/pull/19090))
* Log database query callers. ([Pull Request](https://github.com/rails/rails/pull/26815), [Pull Request](https://github.com/rails/rails/pull/31519), [Pull Request](https://github.com/rails/rails/pull/31690))
* Undefine attribute methods on descendants when resetting column information. ([Pull Request](https://github.com/rails/rails/pull/31475))
* Using subselect for `delete_all` with `limit` or `offset`. ([Commit](https://github.com/rails/rails/commit/9e7260da1bdc0770cf4ac547120c85ab93ff3d48))
* Fixed inconsistency with `first(n)` when used with `limit()`. The `first(n)` finder now respects the `limit()`, making it consistent with `relation.to_a.first(n)`, and also with the behavior of `last(n)`. ([Pull Request](https://github.com/rails/rails/pull/27597))
* Fix nested `has_many :through` associations on unpersisted parent instances. ([Commit](https://github.com/rails/rails/commit/027f865fc8b262d9ba3ee51da3483e94a5489b66))
* Take into account association conditions when deleting through records. ([Commit](https://github.com/rails/rails/commit/ae48c65e411e01c1045056562319666384bb1b63))
* Don't allow destroyed object mutation after `save` or `save!` is called. ([Commit](https://github.com/rails/rails/commit/562dd0494a90d9d47849f052e8913f0050f3e494))
* Fix relation merger issue with `left_outer_joins`. ([Pull Request](https://github.com/rails/rails/pull/27860))
* Support for PostgreSQL foreign tables. ([Pull Request](https://github.com/rails/rails/pull/31549))
* Clear the transaction state when an Active Record object is duped. ([Pull Request](https://github.com/rails/rails/pull/31751))
* Fix not expanded problem when passing an Array object as argument to the where method using `composed_of` column. ([Pull Request](https://github.com/rails/rails/pull/31724))
* Make `reflection.klass` raise if `polymorphic?` not to be misused. ([Commit](https://github.com/rails/rails/commit/63fc1100ce054e3e11c04a547cdb9387cd79571a))
* Fix `#columns_for_distinct` of MySQL and PostgreSQL to make `ActiveRecord::FinderMethods#limited_ids_for` use correct primary key values even if `ORDER BY` columns include other table's primary key. ([Commit](https://github.com/rails/rails/commit/851618c15750979a75635530200665b543561a44))
* Fix `dependent: :destroy` issue for has\_one/belongs\_to relationship where the parent class was getting deleted when the child was not. ([Commit](https://github.com/rails/rails/commit/b0fc04aa3af338d5a90608bf37248668d59fc881))

## Active Model

자세한 변경사항은 [변경로그](https://github.com/rails/rails/blob/5-2-stable/activemodel/CHANGELOG.md)를 참고하세요.

### 주요 변경점

* Fix methods `#keys`, `#values` in `ActiveModel::Errors`. Change `#keys` to only return the keys that don't have empty messages. Change `#values` to only return the not empty values. ([Pull Request](https://github.com/rails/rails/pull/28584))
* Add method `#merge!` for `ActiveModel::Errors`. ([Pull Request](https://github.com/rails/rails/pull/29714))
* Allow passing a Proc or Symbol to length validator options. ([Pull Request](https://github.com/rails/rails/pull/30674))
* Execute `ConfirmationValidator` validation when `_confirmation`'s value is `false`. ([Pull Request](https://github.com/rails/rails/pull/31058))
* Models using the attributes API with a proc default can now be marshalled. ([Commit](https://github.com/rails/rails/commit/0af36c62a5710e023402e37b019ad9982e69de4b))
* Do not lose all multiple `:includes` with options in serialization. ([Commit](https://github.com/rails/rails/commit/853054bcc7a043eea78c97e7705a46abb603cc44))

## Active Support

자세한 변경사항은 변경로그를 참고하세요.

### 제거된 것

* 콜백에서 `:if`, `:unless` 문자열 필터 옵션이 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/c792354adcbf8c966f274915c605c6713b840548))
* `halt_callback_chains_on_return_false` 옵션이 제거되었습니다. ([Commit](https://github.com/rails/rails/commit/19fbbebb1665e482d76cae30166b46e74ceafe29))

### Deprecations

* `Module#reachable?` 메서드가 Deprecated 되었습니다. ([Pull Request](https://github.com/rails/rails/pull/30624))
* `secrets.secret_token`가 Deprecated 되었습니다. ([Commit](https://github.com/rails/rails/commit/fbcc4bfe9a211e219da5d0bb01d894fcdaef0a0e))

### 주요 변경점

* Add `fetch_values` for `HashWithIndifferentAccess`. ([Pull Request](https://github.com/rails/rails/pull/28316))
* Add support for `:offset` to `Time#change`. ([Commit](https://github.com/rails/rails/commit/851b7f866e13518d900407c78dcd6eb477afad06))
* Add support for `:offset` and `:zone` to `ActiveSupport::TimeWithZone#change`. ([Commit](https://github.com/rails/rails/commit/851b7f866e13518d900407c78dcd6eb477afad06))
* Pass gem name and deprecation horizon to deprecation notifications. ([Pull Request](https://github.com/rails/rails/pull/28800))
* Add support for versioned cache entries. This enables the cache stores to recycle cache keys, greatly saving on storage in cases with frequent churn. Works together with the separation of `#cache_key` and `#cache_version` in Active Record and its use in Action Pack's fragment caching. ([Pull Request](https://github.com/rails/rails/pull/29092))
* Add `ActiveSupport::CurrentAttributes` to provide a thread-isolated attributes singleton. Primary use case is keeping all the per-request attributes easily available to the whole system. ([Pull Request](https://github.com/rails/rails/pull/29180))
* `#singularize` and `#pluralize` now respect uncountables for the specified locale. ([Commit](https://github.com/rails/rails/commit/352865d0f835c24daa9a2e9863dcc9dde9e5371a))
* Add default option to `class_attribute`. ([Pull Request](https://github.com/rails/rails/pull/29270))
* Add `Date#prev_occurring` and `Date#next_occurring` to return specified next/previous occurring day of week. ([Pull Request](https://github.com/rails/rails/pull/26600))
* Add default option to module and class attribute accessors. ([Pull Request](https://github.com/rails/rails/pull/29294))
* Cache: `write_multi`. ([Pull Request](https://github.com/rails/rails/pull/29366))
* Default `ActiveSupport::MessageEncryptor` to use AES 256 GCM encryption. ([Pull Request](https://github.com/rails/rails/pull/29263))
* Add `freeze_time` helper which freezes time to `Time.now` in tests. ([Pull Request](https://github.com/rails/rails/pull/29681))
* Make the order of `Hash#reverse_merge!` consistent with `HashWithIndifferentAccess`. ([Pull Request](https://github.com/rails/rails/pull/28077))
* Add purpose and expiry support to `ActiveSupport::MessageVerifier` and `ActiveSupport::MessageEncryptor`. ([Pull Request](https://github.com/rails/rails/pull/29892))
* Update `String#camelize` to provide feedback when wrong option is passed. ([Pull Request](https://github.com/rails/rails/pull/30039))
* `Module#delegate_missing_to` now raises `DelegationError` if target is nil, similar to `Module#delegate`. ([Pull Request](https://github.com/rails/rails/pull/30191))
* Add `ActiveSupport::EncryptedFile` and `ActiveSupport::EncryptedConfiguration`. ([Pull Request](https://github.com/rails/rails/pull/30067))
* Add `config/credentials.yml.enc` to store production app secrets. ([Pull Request](https://github.com/rails/rails/pull/30067))
* Add key rotation support to `MessageEncryptor` and `MessageVerifier`. ([Pull Request](https://github.com/rails/rails/pull/29716))
* Return an instance of `HashWithIndifferentAccess` from `HashWithIndifferentAccess#transform_keys`. ([Pull Request](https://github.com/rails/rails/pull/30728))
* `Hash#slice` now falls back to Ruby 2.5+'s built-in definition if defined. ([Commit](https://github.com/rails/rails/commit/01ae39660243bc5f0a986e20f9c9bff312b1b5f8))
* `IO#to_json` now returns the `to_s` representation, rather than attempting to convert to an array. This fixes a bug where `IO#to_json`would raise an `IOError` when called on an unreadable object. ([Pull Request](https://github.com/rails/rails/pull/30953))
* Add same method signature for `Time#prev_day` and `Time#next_day` in accordance with `Date#prev_day`, `Date#next_day`. Allows pass argument for `Time#prev_day` and `Time#next_day`. ([Commit](https://github.com/rails/rails/commit/61ac2167eff741bffb44aec231f4ea13d004134e))
* Add same method signature for `Time#prev_month` and `Time#next_month` in accordance with `Date#prev_month`, `Date#next_month`. Allows pass argument for `Time#prev_month`and `Time#next_month`. ([Commit](https://github.com/rails/rails/commit/f2c1e3a793570584d9708aaee387214bc3543530))
* Add same method signature for `Time#prev_year` and `Time#next_year` in accordance with `Date#prev_year`, `Date#next_year`. Allows pass argument for `Time#prev_year` and `Time#next_year`. ([Commit](https://github.com/rails/rails/commit/ee9d81837b5eba9d5ec869ae7601d7ffce763e3e))
* Fix acronym support in `humanize`. ([Commit](https://github.com/rails/rails/commit/0ddde0a8fca6a0ca3158e3329713959acd65605d))
* Allow `Range#include?` on TWZ ranges. ([Pull Request](https://github.com/rails/rails/pull/31081))
* Cache: Enable compression by default for values > 1kB. ([Pull Request](https://github.com/rails/rails/pull/31147))
* Redis cache store. ([Pull Request](https://github.com/rails/rails/pull/31134), [Pull Request](https://github.com/rails/rails/pull/31866))
* Handle `TZInfo::AmbiguousTime` errors. ([Pull Request](https://github.com/rails/rails/pull/31128))
* MemCacheStore: Support expiring counters. ([Commit](https://github.com/rails/rails/commit/b22ee64b5b30c6d5039c292235e10b24b1057f6d))
* Make `ActiveSupport::TimeZone.all` return only time zones that are in `ActiveSupport::TimeZone::MAPPING`. ([Pull Request](https://github.com/rails/rails/pull/31176))
* Changed default behaviour of `ActiveSupport::SecurityUtils.secure_compare`, to make it not leak length information even for variable length string. Renamed old `ActiveSupport::SecurityUtils.secure_compare` to `fixed_length_secure_compare`, and started raising `ArgumentError` in case of length mismatch of passed strings. ([Pull Request](https://github.com/rails/rails/pull/24510))
* Use SHA-1 to generate non-sensitive digests, such as the ETag header. ([Pull Request](https://github.com/rails/rails/pull/31289), [Pull Request](https://github.com/rails/rails/pull/31651))
* `assert_changes` will always assert that the expression changes, regardless of `from:` and `to:` argument combinations. ([Pull Request](https://github.com/rails/rails/pull/31011))
* Add missing instrumentation for `read_multi` in `ActiveSupport::Cache::Store`. ([Pull Request](https://github.com/rails/rails/pull/30268))
* Support hash as first argument in `assert_difference`. This allows to specify multiple numeric differences in the same assertion. ([Pull Request](https://github.com/rails/rails/pull/31600))
* Caching: MemCache and Redis `read_multi` and `fetch_multi`speedup. Read from the local in-memory cache before consulting the backend. ([Commit](https://github.com/rails/rails/commit/a2b97e4ffef971607a1be8fc7909f099b6840f36))

## Active Job

자세한 변경사항은 [변경로그](https://github.com/rails/rails/blob/5-2-stable/activejob/CHANGELOG.md)를 참고하세요.

### 주요 변경점

* `ActiveJob::Base.discard_on` 메서드에 블럭을 전달해서 잡 취소를 커스텀으로 처리하는 것을 허용합니다. ([Pull Request](https://github.com/rails/rails/pull/30622))

## 가이드 문서

자세한 변경사항은 [변경로그](https://github.com/rails/rails/blob/5-2-stable/guides/CHANGELOG.md)를 참고하세요.

### 주요 변경점

* [레일즈에서 멀티스레드 코드 실행하기](http://edgeguides.rubyonrails.org/threading_and_code_execution.html) 가이드가 추가되었습니. ([Pull Request](https://github.com/rails/rails/pull/27494))
* [액티브 스토리지 둘러보기](http://edgeguides.rubyonrails.org/active_storage_overview.html) 가이드가 추가되었습니다. ([Pull Request](https://github.com/rails/rails/pull/31037))

## 크레딧

레일즈를 견고하고 안정적인 프레임워크로 만들기 위해 많은 시간을 사용해주신 많은 개발자들을 [레일즈 기여자 목록](http://contributors.rubyonrails.org/)에서 확인할 수 있습니다. 이 분들에게 경의를 표합니다.
