1 Rails 8.1로 업그레이드
기존 애플리케이션을 업그레이드하는 경우, 진행하기 전에 충분한 테스트 커버리지를 확보하는 것이 좋습니다. 또한 아직 하지 않았다면 먼저 Rails 8.0으로 업그레이드하고, Rails 8.1로 업데이트를 시도하기 전에 애플리케이션이 예상대로 작동하는지 확인해야 합니다. 업그레이드 시 주의해야 할 사항 목록은 Ruby on Rails 업그레이드하기 가이드에서 확인할 수 있습니다.
2 주요 기능
3 Railties
자세한 변경 사항은 Changelog를 참조하세요.
3.1 Removals
더 이상 사용되지 않는
Rails::Generators::Testing::Behaviour
가 제거되었습니다.더 이상 사용되지 않는
Rails.application.secrets
가 제거되었습니다.더 이상 사용되지 않는
Rails.config.enable_dependency_loading
이 제거되었습니다.더 이상 사용되지 않는
find_cmd_and_exec
console helper가 제거되었습니다.
3.2 기능 지원 중단(Deprecations)
3.3 주요 변경사항
4 Action Cable
자세한 변경사항은 Changelog를 참조하세요.
4.1 제거된 기능들
4.2 지원 중단(Deprecations)
4.3 주요 변경사항
5 Action Pack
자세한 변경사항은 Changelog를 참조해주세요.
5.1 삭제 항목
더 이상 사용되지 않는 상수
ActionDispatch::IllegalStateError
가 제거되었습니다.더 이상 사용되지 않는 상수
AbstractController::Helpers::MissingHelperError
가 제거되었습니다.더 이상 사용되지 않는
ActionController::Parameters
와Hash
간의 비교가 제거되었습니다.더 이상 사용되지 않는
Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type
가 제거되었습니다.더 이상 사용되지 않는
speaker
,vibrate
,vr
permissions policy directives가 제거되었습니다.Rails.application.config.action_dispatch.show_exceptions
를true
와false
로 설정하는 더 이상 사용되지 않는 지원이 제거되었습니다.
5.2 지원 중단
-
Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality
를 지원 중단합니다.
5.3 주목할 만한 변경사항
6 Action View
자세한 변경사항은 Changelog를 참조하세요.
6.1 제거사항
- Deprecated된
@rails/ujs
가 제거되었으며Turbo
로 대체되었습니다.
6.2 지원 중단
tag.br
과 같은 tag builders를 사용할 때 void elements에 콘텐츠를 전달하는 것은 지원 중단됩니다.
6.3 주목할 만한 변경사항
7 Action Mailer
자세한 변경사항은 Changelog를 참조하세요.
7.1 제거사항
더 이상 사용되지 않는
config.action_mailer.preview_path
가 제거되었습니다.assert_enqueued_email_with
에서:args
를 통한 더 이상 사용되지 않는 params가 제거되었습니다.
7.2 지원 중단(Deprecations)
7.3 주목할 만한 변경사항
8 Active Record
자세한 변경사항은 Changelog를 참조하세요.
8.1 제거된 기능
Deprecated된
Rails.application.config.active_record.suppress_multiple_database_warning
제거.존재하지 않는 attribute 이름으로
alias_attribute
를 호출하는 deprecated된 지원 제거.ActiveRecord::Base.remove_connection
에서 deprecated된name
인자 제거.Deprecated된
ActiveRecord::Base.clear_active_connections!
제거.Deprecated된
ActiveRecord::Base.clear_reloadable_connections!
제거.Deprecated된
ActiveRecord::Base.clear_all_connections!
제거.Deprecated된
ActiveRecord::Base.flush_idle_connections!
제거.Deprecated된
ActiveRecord::ActiveJobRequiredError
제거.Connection adapter에서 2개의 인자를 사용하는
explain
정의에 대한 deprecated된 지원 제거.Deprecated된
ActiveRecord::LogSubscriber.runtime
메서드 제거.Deprecated된
ActiveRecord::LogSubscriber.runtime=
메서드 제거.Deprecated된
ActiveRecord::LogSubscriber.reset_runtime
메서드 제거.Deprecated된
ActiveRecord::Migration.check_pending
메서드 제거.ActiveRecord::MigrationContext
에SchemaMigration
과InternalMetadata
클래스를 인자로 전달하는 deprecated된 지원 제거.단수형 association을 복수형 이름으로 참조하는 것을 지원하는 deprecated된 동작 제거.
Deprecated된
TestFixtures.fixture_path
제거.사용자 정의 primary key 값을 반환하기 위한
ActiveRecord::Base#read_attribute(:id)
에 대한 deprecated된 지원 제거.serialize
의 두 번째 인자로 coder와 class를 전달하는 deprecated된 지원 제거.Database adapter에서 deprecated된
#all_foreign_keys_valid?
제거.Deprecated된
ActiveRecord::ConnectionAdapters::SchemaCache.load_from
제거.Deprecated된
ActiveRecord::ConnectionAdapters::SchemaCache#data_sources
제거.Deprecated된
#all_connection_pools
제거.role
인자가 제공되지 않았을 때 현재 role에 대한 connection pool에#connection_pool_list
,#active_connections?
,#clear_active_connections!
,#clear_reloadable_connections!
,#clear_all_connections!
,#flush_idle_connections!
를 적용하는 deprecated된 지원 제거.deprecated된
ActiveRecord::ConnectionAdapters::ConnectionPool#connection_klass
를 제거했습니다.deprecated된
#quote_bound_value
를 제거했습니다.deprecated된
ActiveSupport::Duration
quote 지원을 제거했습니다.deprecated된
add_foreign_key
에deferrable: true
를 전달하는 지원을 제거했습니다.deprecated된
ActiveRecord::Relation#merge
에rewhere
를 전달하는 지원을 제거했습니다.return
,break
또는throw
를 사용하여 빠져나올 때 transaction 블록을 롤백하는 deprecated된 동작을 제거했습니다.
8.2 지원 중단 예정 기능
Rails.application.config.active_record.allow_deprecated_singular_associations_name
지원 중단 예정Rails.application.config.active_record.commit_transaction_on_non_local_return
지원 중단 예정
8.3 주목할 만한 변경사항
9 Active Storage
자세한 변경사항은 Changelog를 참조하세요.
9.1 제거사항
더 이상 사용되지 않는
config.active_storage.replace_on_assign_to_many
가 제거되었습니다.더 이상 사용되지 않는
config.active_storage.silence_invalid_content_types_warning
이 제거되었습니다.
9.2 지원 중단
Deprecation 공지는 애플리케이션 유지보수를 개선하는 데 도움이 됩니다. Deprecation은 코드가 미래의 버전에서 제거될 예정임을 알려줍니다. 일정 시간 동안의 전환 기간을 두어 애플리케이션을 점진적으로 업그레이드할 수 있게 합니다.
버전이 지정된 모든 deprecation은 애플리케이션의 deprecation이 없는 최신 Rails에서 동작하도록 하기 위해 업데이트되어야 합니다.
9.3 주목할 만한 변화들
10 Active Model
자세한 변경사항은 Changelog를 참조하세요.
10.1 제거
Removed features are removed completely without any deprecation warning. While older versions of Rails 7.x may have supported these features, Rails 7.1+ removes them completely.
완전히 제거된 기능들은 어떠한 deprecation 경고도 없이 제거되었습니다. Rails 7.x의 이전 버전에서는 이러한 기능들을 지원했을 수 있지만, Rails 7.1+ 에서는 완전히 제거되었습니다.
10.2 사용 중단
10.3 주목할 만한 변경사항
11 Active Support
자세한 변경사항은 Changelog를 참조하세요.
11.1 Removals
더 이상 사용되지 않는
ActiveSupport::Notifications::Event#children
과ActiveSupport::Notifications::Event#parent_of?
가 제거되었습니다.deprecator 전달 없이 다음 메서드들을 호출하는 것에 대한 더 이상 사용되지 않는 지원이 제거되었습니다:
deprecate
deprecate_constant
ActiveSupport::Deprecation::DeprecatedObjectProxy.new
ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new
ActiveSupport::Deprecation::DeprecatedConstantProxy.new
assert_deprecated
assert_not_deprecated
collect_deprecations
더 이상 사용되지 않는
ActiveSupport::Deprecation
인스턴스로의 위임이 제거되었습니다.더 이상 사용되지 않는
SafeBuffer#clone_empty
가 제거되었습니다.Array
,Date
,DateTime
와Time
에서 더 이상 사용되지 않는#to_default_s
가 제거되었습니다.cache storage에 대한 더 이상 사용되지 않는
:pool_size
와:pool_timeout
옵션이 제거되었습니다.config.active_support.cache_format_version = 6.1
에 대한 더 이상 사용되지 않는 지원이 제거되었습니다.더 이상 사용되지 않는 상수
ActiveSupport::LogSubscriber::CLEAR
와ActiveSupport::LogSubscriber::BOLD
가 제거되었습니다.ActiveSupport::LogSubscriber#color
에서 위치 기반 boolean으로 로그 텍스트를 굵게 만드는 더 이상 사용되지 않는 지원이 제거되었습니다.더 이상 사용되지 않는
config.active_support.disable_to_s_conversion
이 제거되었습니다.더 이상 사용되지 않는
config.active_support.remove_deprecated_time_with_zone_name
이 제거되었습니다.더 이상 사용되지 않는
config.active_support.use_rfc4122_namespaced_uuids
가 제거되었습니다.MemCacheStore
에Dalli::Client
인스턴스를 전달하는 더 이상 사용되지 않는 지원이 제거되었습니다.로컬 시간대의
Time
객체를 반환하는 Ruby 2.4 이전의to_time
동작에 대한 더 이상 사용되지 않는 지원이 제거되었습니다.
11.2 지원 중단 예정
config.active_support.to_time_preserves_timezone
가 지원 중단 예정입니다.DateAndTime::Compatibility.preserve_timezone
가 지원 중단 예정입니다.
11.3 주목할 만한 변화
12 Active Job
자세한 변경 사항은 Changelog를 참조하세요.
12.1 삭제된 기능들
BigDecimal
인자에 대해 더 이상 사용되지 않는 primitive serializer가 제거되었습니다.scheduled_at
속성에 숫자값을 설정하는 더 이상 사용되지 않는 기능이 제거되었습니다.retry_on
의:wait
옵션에서 더 이상 사용되지 않는:exponentially_longer
값이 제거되었습니다.
12.2 Deprecations
Rails.application.config.active_job.use_big_decimal_serialize
는 더 이상 사용되지 않습니다.
12.3 주목할만한 변경사항
13 Action Text
자세한 변경사항은 Changelog를 참조하세요.
13.1 제거 사항들
sprockets-rails
가 기본적으로 Gemfile에서 제거되었습니다. (Pull Request)새로운 애플리케이션들은 이제 더이상
concurrent-ruby
gem을 요구하지 않습니다. (Pull Request)config.cache_store = :null_store
는 더이상 기본적으로 development 환경에서 세팅되지 않습니다. (Commit)더이상 필요하지 않은
config.action_controller.allow_deprecated_parameters_hash_type
를 제거했습니다. (Commit)config.action_dispatch.cookies_serializer = :hybrid
을 제거했습니다. (Commit)Rails 6.1에서 deprecated된 Active Storage 관련 메서드들을 제거했습니다. (Commit)
Rails 6.1에서 deprecated된
Rails.application.credentials.will_ensure_secrets_are_mounted_in_production!
메서드를 제거했습니다. (Commit)더이상 사용되지 않는
config.active_support.use_sha1_digests
를 제거했습니다. (Commit)오랫동안 deprecated되었던
ActionController::Parameters#transform_keys
와ActionController::Parameters#transform_keys!
를 제거했습니다. (Commit)
13.2 Deprecations (사용중단 예정)
이 섹션에서는 Active Storage가 향후 릴리즈에서 사용중단되거나 중요한 변화가 있을 기능들을 나열합니다.
아래에 나열된 각각의 변경 내용과 대안은 Rails 7.1 이상의 버전에서는 이미 적용되어 있습니다.
모든 non-private services에 service_urls 사용 가능하도록 설정하기를 더 이상 권장하지 않습니다. service_urls_enabled를
true
로 설정하는 것을 중단할 예정입니다. 대신 필요한 service마다 개별적으로 설정하는 것을 추천합니다.config.active_storage.service_urls_expire_in = 5.minutes
# Use: config.service.url_expires_in = 5.minutes
ActiveStorage::Current.host
를 호출할 수 있게 하는 설정은 제거될 예정입니다. 이것은 확장성 문제를 일으킬 수 있는 bad practice로 간주됩니다. 대신Rails.application.routes.url_helpers
를 사용하는 것을 권장합니다.mini_mime
gem의 사용이 점진적으로 중단될 예정입니다. 대신marcel
gem을 content type 탐지에 사용하는 것을 권장합니다.
13.3 주목할 만한 변경사항
14 Action Mailbox
자세한 변경사항은 Changelog를 참조하세요.
14.1 삭제
14.2 지원 중단 안내
The
bin/rails secrets:setup
command is deprecated in favor ofbin/rails credentials:edit
The
bin/rails secrets:edit
command is deprecated in favor ofbin/rails credentials:edit
The
secrets.yml
and secrets API are deprecated in favor ofconfig/credentials.yml.enc
and Rails.application.credentialsDeprecated passing a single argument to
assert_difference
when the default of 1 is intended. Explicitly pass the difference(1)
The
host
argument toassert_redirected_to
has been deprecated. Pass the full URL insteadThe
--skip-coffee
option to various generators has been deprecated as Coffeescript is no longer included by default
14.3 주목할만한 변경 사항
15 Ruby on Rails 가이드
자세한 변경 사항은 변경 이력을 참조하세요.
15.1 주목할 만한 변경사항
16 공헌자 명단
Rails를 안정적이고 견고한 프레임워크로 만들기 위해 수많은 시간을 투자한 많은 사람들을 보려면 Rails 전체 공헌자 목록을 참조하세요. 그들 모두에게 찬사를 보냅니다.