-
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
Allow dashboards for different groups to have the same name #19491
Allow dashboards for different groups to have the same name #19491
Conversation
…board uniqueness Issue: ManageIQ#18924
360fa5b
to
208f611
Compare
6c8c7ee
to
a7bb025
Compare
app/models/miq_widget_set.rb
Outdated
userid = user.try(:userid) | ||
group_id = user.try(:current_group_id) | ||
# a unique record is defined by name, group_id and userid | ||
where(:name => name, :group_id => group_id, :userid => userid) | ||
if userid.present? | ||
where(:name => name, :group_id => group_id, :userid => userid) |
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.
You can also basically remove the group_id variable now, and just use user.current_group_id
, since the group_id isn;t needed elsewhere, and you don't need the try because you've checked userid is present.
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.
👍
I expected to see a change to a validator in this code, but there isn't one. I'm also curious if the data migration and most of this code is even needed if we can get away with |
No need to change validation in lib/extentions/ar_miq_sert.rb:
the same logic still, but instead of .
|
… trying to get dashboards for all groups
a7bb025
to
6ca85cb
Compare
Checked commits yrudman/manageiq@c691cd3~...6ca85cb with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
…d to group This PR should go together with ManageIQ/manageiq#19491 Fixes issue ManageIQ/manageiq#18924
…d to group This PR should go together with ManageIQ/manageiq#19491 Fixes issue ManageIQ/manageiq#18924
…d to group This PR should go together with ManageIQ/manageiq#19491 Fixes issue ManageIQ/manageiq#18924
We previously expected a duplicate dashboard name to raise an error and it no longer is a problem as of ManageIQ/manageiq#19491
Fixes #18924
This PR should go together with Data Migration PR ManageIQ/manageiq-schema#432, which will copy
owner_id
togroup_id