-
Notifications
You must be signed in to change notification settings - Fork 897
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
Remove hacked relations #17545
Remove hacked relations #17545
Conversation
app/models/miq_request.rb
Outdated
if get_option(:schedule_type) == "schedule" | ||
deliver_on = get_option(:schedule_time).utc rescue nil | ||
start_time = get_option(:schedule_time).utc rescue nil |
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.
Copying @gmcculloug 's comment (#17520 (comment))
I would recommend that we refactor this line. The classic UI sets get_option(:schedule_time) to a ActiveSupport::TimeWithZone object which supports the utc call.
I suspect that if this is set from the API or some other means it would set the time as a string in which case the code will silently error and use nil. It is also a good opportunity to get rid of the inline rescue as well.
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.
👍 Totally agree, but I would prefer to fix it in a different PR since it's an unrelated issue
app/models/miq_schedule.rb
Outdated
@@ -1,4 +1,7 @@ | |||
class MiqSchedule < ApplicationRecord | |||
include DeprecationMixin | |||
deprecate_attribute :towhat, :resource_type |
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.
Sorry @jrafanie but there are still some other models with a tow hat 😆
152abcc
to
ec8deec
Compare
7ca7614
to
0652dd1
Compare
This pull request is not mergeable. Please rebase and repush. |
0652dd1
to
1ff0da7
Compare
Some comments on commits bdunne/manageiq@8829e85~...1ff0da7 spec/models/miq_schedule_spec.rb
|
Checked commits bdunne/manageiq@8829e85~...1ff0da7 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/models/miq_schedule.rb
app/models/service_template.rb
|
This warning was added as part of: ManageIQ/manageiq#17545 There are other uses of `towhat` in the repo but it is only a problem with `miq_schedule` records being created by these factories that can be fixed here.
Depends on:
#17588
ManageIQ/manageiq-schema#212