Skip to content

Commit 6bcaa0f

Browse files
authored
Merge pull request rails#54269 from chaadow/patch-2
Remove deprecated call to mb_chars
2 parents b458ed8 + afd265d commit 6bcaa0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ def generate_index_name(table_name, column)
16051605
name = "idx_on_#{Array(column) * '_'}"
16061606

16071607
short_limit = max_index_name_size - hashed_identifier.bytesize
1608-
short_name = name.mb_chars.limit(short_limit).to_s
1608+
short_name = name.truncate_bytes(short_limit, omission: nil)
16091609

16101610
"#{short_name}#{hashed_identifier}"
16111611
end

0 commit comments

Comments
 (0)