Skip to content

Replace mb_chars.limit with truncate_bytes in format_sync_error - #24000

Merged
agrare merged 1 commit into
ManageIQ:masterfrom
jrafanie:rails-8-1-deprecation-mb-chars
Oct 8, 2026
Merged

agrare merged 1 commit into
ManageIQ:masterfrom
jrafanie:rails-8-1-deprecation-mb-chars

Conversation

@jrafanie

@jrafanie jrafanie commented Oct 5, 2026

Copy link
Copy Markdown
Member

String#mb_chars is deprecated in Rails 8.1 and will be removed in 8.2. truncate_bytes(n, omission: nil) is the idiomatic ActiveSupport replacement

  • available since Rails 6.0 so it works on 8.0 and 8.1 without shims.

Part of #23946 (Rails 8.1 deprecation)

See also https://www.github.com/rails/rails/pull/54269

@jrafanie
jrafanie requested review from Fryguy and agrare as code owners October 5, 2026 20:37
@jrafanie jrafanie closed this Oct 5, 2026
@jrafanie jrafanie reopened this Oct 5, 2026
@jrafanie
jrafanie force-pushed the rails-8-1-deprecation-mb-chars branch from c8eed5f to 92291f8 Compare October 6, 2026 19:44
@miq-bot

miq-bot commented Oct 6, 2026

Copy link
Copy Markdown
Member

Checked commit jrafanie@92291f8 with ruby 3.3.12, rubocop 1.91.0, haml-lint 0.78.0, and yamllint 1.37.1
2 files checked, 2 offenses detected

app/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script_source.rb

spec/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script_source_spec.rb

@Fryguy Fryguy added the cleanup label Oct 7, 2026
String#mb_chars is deprecated in Rails 8.1 and will be removed in 8.2.
truncate_bytes(n, omission: nil) is the idiomatic ActiveSupport replacement
- available since Rails 6.0 so it works on 8.0 and 8.1 without shims.

Part of ManageIQ#23946 (Rails 8.1 deprecation)

See also https://www.github.com/rails/rails/pull/54269
@jrafanie
jrafanie force-pushed the rails-8-1-deprecation-mb-chars branch from f1b8e8a to c83bbfa Compare October 7, 2026 20:27
@agrare
agrare merged commit 091a11b into ManageIQ:master Oct 8, 2026
6 checks passed
@jrafanie
jrafanie deleted the rails-8-1-deprecation-mb-chars branch October 10, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants