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
Use string class name instead of hitting autoload #18629
Use string class name instead of hitting autoload #18629
Conversation
DEPRECATION WARNING: Passing a class to the `class_name` is deprecated and will raise an ArgumentError in Rails 5.2. It eagerloads more classes than necessary and potentially creates circular dependencies. Please pass the class name as a string: `has_many :public_network_routers, class_name: 'NetworkRouter'` (called from <class:CloudNetwork> at /Users/joerafaniello/Code/manageiq/app/models/cloud_network.rb:21)
@@ -1,7 +1,7 @@ | |||
class ContainerGroupPerformance < MetricRollup | |||
default_scope { where("resource_type = 'ContainerGroup' and resource_id IS NOT NULL") } | |||
|
|||
belongs_to :container_group, :foreign_key => :resource_id, :class_name => ContainerGroup.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️
Checked commit jrafanie@b9bbb0d with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/models/cloud_network.rb
app/models/container_group.rb
app/models/container_group_performance.rb
app/models/container_image.rb
app/models/container_node.rb
app/models/container_node_performance.rb
app/models/container_performance.rb
app/models/container_project_performance.rb
app/models/conversion_host.rb
app/models/notification.rb
|
Related to #18076 |
DEPRECATION WARNING: Passing a class to the
class_name
is deprecatedand will raise an ArgumentError in Rails 5.2. It eagerloads more classes
than necessary and potentially creates circular dependencies. Please
pass the class name as a string:
has_many :public_network_routers, class_name: 'NetworkRouter'
(called from class:CloudNetwork at/Users/joerafaniello/Code/manageiq/app/models/cloud_network.rb:21)
🤣 the branch name 🤣 cc @gtanzillo @Fryguy