-
Notifications
You must be signed in to change notification settings - Fork 898
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
Adding PhysicalStorage into PhysicalChassis #17616
Conversation
3d723c8
to
b8bfd6d
Compare
bede9b8
to
a1413c0
Compare
d8a97f4
to
4f12220
Compare
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.
Looks good!
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.
Looks good!
Sorry for the double review. Internet connection is making fun of me. |
This looks fine to me but depends on ManageIQ/manageiq-schema#224 |
@agrare : can you merge both? |
@martinpovolny no we need @Fryguy to merge the schema one |
@agrare Sorry for that, I fixed it now. |
57c4bab
to
2d112ad
Compare
@agrare Since the schema PR was merged, I think this one is ok too. Could you check it out? |
app/models/physical_storage.rb
Outdated
belongs_to :physical_rack, :foreign_key => :physical_rack_id, :inverse_of => :physical_storages | ||
belongs_to :physical_chassis, :foreign_key => :physical_chassis_id, :inverse_of => :physical_storages |
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.
Do you need to specify the foreign_key here? It should "just work"
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.
Initially I thought that it was necessary, but it doesn't, so I removed it now.
has_many :physical_chassis, :dependent => :nullify, :inverse_of => :physical_rack | ||
has_many :physical_servers, :dependent => :nullify, :inverse_of => :physical_rack | ||
has_many :physical_storages, :dependent => :nullify, :inverse_of => :physical_rack |
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.
This is just adding an association that already existing on the physical_storage model right? Nothing was changed in schema for this to work.
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.
Yes, it doesn't change nothing in schema. This was done because PhysicalRack
requires an association with PhysicalStorage
in order to get them when needed. If this is not added, then we can get a PhysicalRack
from a PhysicalStorage
, but the inverse does not work.
2d112ad
to
b01d027
Compare
Checked commit EsdrasVP@b01d027 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Adding PhysicalStorage into PhysicalChassis
This PR is able to:
Depends on:
ManageIQ/manageiq-schema#224[Merged]