Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rails 7 deprecation/7.1 removal by using Integer#to_fs(:human_size) #759

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

jrafanie
Copy link
Member

Fixes the following error on rails 7.1:

TypeError:
  no implicit conversion of Symbol into Integer
Shared Example Group: "used" called from ./spec/content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/used_spec.rb:59
  ./content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/used.rb:25:in `to_s'
  ./content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/used.rb:25:in `used'
  ./content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/used.rb:18:in `main'
  ./spec/content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/used_spec.rb:41:in `block (3 levels) in <top (required)>'

Fixes the following deprecation warnings that should have picked this up on rails 7:

DEPRECATION WARNING: Time#to_s(:db) is deprecated. Please use Time#to_fs(:db) instead. DEPRECATION WARNING: Integer#to_s(:human_size) is deprecated. Please use Integer#to_fs(:human_size) instead.

A similar change was fixed in here in commit:
ManageIQ/manageiq@21bc1a9 Part of this PR for Rails 7: ManageIQ/manageiq#22873

Fixes the following error on rails 7.1:

TypeError:
  no implicit conversion of Symbol into Integer
Shared Example Group: "used" called from ./spec/content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/used_spec.rb:59
  ./content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/used.rb:25:in `to_s'
  ./content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/used.rb:25:in `used'
  ./content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/used.rb:18:in `main'
  ./spec/content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/used_spec.rb:41:in `block (3 levels) in <top (required)>'

Fixes the following deprecation warnings that should have picked this up on rails 7:
DEPRECATION WARNING: Time#to_s(:db) is deprecated. Please use Time#to_fs(:db) instead.
DEPRECATION WARNING: Integer#to_s(:human_size) is deprecated. Please use Integer#to_fs(:human_size) instead.

A similar change was fixed in here in commit:
ManageIQ/manageiq@21bc1a9
Part of this PR for Rails 7: ManageIQ/manageiq#22873
@jrafanie
Copy link
Member Author

Note, this is fully backward compatible.

@Fryguy Fryguy merged commit 5d786a5 into ManageIQ:master Jan 30, 2025
3 checks passed
@Fryguy Fryguy self-assigned this Jan 30, 2025
@jrafanie jrafanie deleted the fix-rails-7-1 branch January 30, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants