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

Rails 7 #22873

Merged
merged 5 commits into from
Aug 6, 2024
Merged

Rails 7 #22873

merged 5 commits into from
Aug 6, 2024

Commits on Aug 6, 2024

  1. Update to latest rails 7.0 gems

    Require minimum for the CVE fixes:
    https://rubyonrails.org/2024/6/4/Rails-Versions-6-1-7-8-7-0-8-4-and-7-1-3-4-have-been-released
    
    Use virtual attributes 7.0 and other gems that support rails 7.
    jrafanie committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    3b74f5a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9b6ebb1 View commit details
    Browse the repository at this point in the history
  3. Use Rails 7 interface for the Preloader

    See rails commit: e3b9779cb701c63012bc1af007c71dc5a888d35a
    
    Very similar to the change found in:
    https://github.com/ManageIQ/activerecord-virtual_attributes/pull/133/files
    
    Stub/mock the preloader in a rails 7 compatible way
    
    Rails 7 preloader requires a scope relation, not an array
    
    Note, it looks like only singular associations for already
    available_records are preloaded with an optimization in rails 7.
    
    See: https://www.github.com/rails/rails/pull/42654
    jrafanie committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    3263fdd View commit details
    Browse the repository at this point in the history
  4. Fix rails 7 deprecation warnings

    Fixes the following deprecation warnings:
    DEPRECATION WARNING: Time#to_s(:db) is deprecated. Please use Time#to_fs(:db) instead. (called from block (2 levels) in add_metric_rollups_for at /Users/joerafaniello/Code/manageiq/spec/support/chargeback_helper.rb:43)
    DEPRECATION WARNING: Integer#to_s(:human_size) is deprecated. Please use Integer#to_fs(:human_size) instead. (called from block in build_disk_message at /Users/joerafaniello/Code/manageiq/app/models/vm_reconfigure_task.rb:43)
    DEPRECATION WARNING: Integer#to_s(:human_size) is deprecated. Please use Integer#to_fs(:human_size) instead. (called from block (3 levels) in <main> at /Users/joerafaniello/Code/manageiq/spec/models/vm_reconfigure_task_spec.rb:45)
    DEPRECATION WARNING: Integer#to_s(:human_size) is deprecated. Please use Integer#to_fs(:human_size) instead. (called from block (3 levels) in <main> at /Users/joerafaniello/Code/manageiq/spec/models/vm_reconfigure_task_spec.rb:58)
    DEPRECATION WARNING: Integer#to_s(:human_size) is deprecated. Please use Integer#to_fs(:human_size) instead. (called from block (3 levels) in <main> at /Users/joerafaniello/Code/manageiq/spec/models/vm_reconfigure_task_spec.rb:59)
    jrafanie committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    21bc1a9 View commit details
    Browse the repository at this point in the history
  5. Ignore calls to subclasses and descendants from rails 7 callers

    Rails changed in 7.0 to call subclasses from reload_schema_from_cache here:
    rails/rails@6f30cc0
    
    It also changed to call descendants on the callback class (self) insead of
    the ActiveSupport::DescendantsTracker here:
    rails/rails@ffae3bd
    
    We're now getting called in descendants and subclasses from rails very
    early, at code load time, before models or as models are in between loading.
    We cannot trigger loads of subclasses while we're loading the existing class
    so we must wait and avoid it at this point.
    jrafanie committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    b85a0c7 View commit details
    Browse the repository at this point in the history