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

Use string class name instead of hitting autoload #18629

Merged

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Apr 4, 2019

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)

🤣 the branch name 🤣 cc @gtanzillo @Fryguy

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣 😆

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂️

@miq-bot
Copy link
Member

miq-bot commented Apr 4, 2019

Checked commit jrafanie@b9bbb0d with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
11 files checked, 14 offenses detected

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

@jrafanie
Copy link
Member Author

jrafanie commented Apr 4, 2019

Related to #18076

@carbonin carbonin added the core label Apr 5, 2019
@carbonin carbonin self-assigned this Apr 5, 2019
@carbonin carbonin merged commit 351d032 into ManageIQ:master Apr 5, 2019
@carbonin carbonin added this to the Sprint 109 Ending Apr 15, 2019 milestone Apr 5, 2019
@jrafanie jrafanie deleted the avoid_constant_problems_with_autoload branch October 4, 2019 19:46
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.

None yet

3 participants