-
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
Rails 5-1 #18076
Rails 5-1 #18076
Conversation
For fun, autoload doesn't work in application.rb, so you have to either do it in an config/initializers or require the file. rails/rails@83b767ce Rails issue: #25525 Extracted from ManageIQ#18076
Rails 5.1 removed support for specifying a string/symbol for the middleware class. You must now use a constant. For fun, autoload doesn't work in application.rb, so you have to either do it in an config/initializers or require the file. rails/rails@83b767ce Rails issue: #25525 Extracted from ManageIQ#18076
To avoid relying on the connection to type cast the binds, this method was removed. It was replaced with the underlying implementation of the method, which is also used here to replace our usage. rails/rails@5465508 Extracted from ManageIQ#18076
The force reload parameter was removed from assocations in: rails/rails@09cac8c67af It was previously deprecated but apparently we didn't fix that warning. Extracted from ManageIQ#18076
The force reload parameter was removed from associations in: rails/rails@09cac8c67af It was previously deprecated but apparently we didn't fix that warning. Extracted from ManageIQ#18076
According to 85c0224, we want the cascading delete to avoid orphaned resources, so we'll remove the one that doesn't explicitly say dependent => destroy. Rails 5.1+ complains about has_many through associations if the through association is not yet defined, and in this case, the second host_storages association occurs after the through association, so rails yells: ``` ActiveRecord::HasManyThroughOrderError: Cannot have a has_many :through association 'Storage#hosts' which goes through 'Storage#host_storages' before the through association is defined. ``` Extracted from ManageIQ#18076
Rails 5.1+ complains about has_many through associations if the through association is not yet defined. Extracted from ManageIQ#18076
Rails ~5.1 changed arity from 1 to 0 in commit: rails/rails@a553302 Extracted from ManageIQ#18076
Rails exists? with empty hash in ancestry 2.2.x was broken by rails PR: 28699 Fixed in ancestry 3.0.0: stefankroes/ancestry@8c43482 Extracted from ManageIQ#18076
The force reload parameter was removed from associations in: rails/rails@09cac8c67af It was previously deprecated here: rails/rails@6eae366 From that commit: For collections: @user.posts.reload # Instead of @user.posts(true) For singular associations: @user.reload.profile # Instead of @user.profile(true) Extracted from ManageIQ#18076
Note, the before_save was calling remove_invalid_resource on create which didn't make sense because it was trying to find service_resources with orphaned resources, which can't happen unless the service_template itself has been saved. Because of this, it makes sense to change this to before_update instead of adding r.persisted? checks in the remove_invalid_resource method. The force reload parameter was removed from associations in: rails/rails@09cac8c67af It was previously deprecated here: rails/rails@6eae366 From that commit: For collections: @user.posts.reload # Instead of @user.posts(true) For singular associations: @user.reload.profile # Instead of @user.profile(true) Extracted from ManageIQ#18076
a5491e4
to
24028ae
Compare
@himdel @h-kataria @Fryguy @bdunne this is ready to go. The talk article was written. Is there anything else we need? Here's the talk article. These can be merged with rails 5.0 (now) as they will go red when 5.1 lands:
The only other remaining items can only be merged after 5.1 is merged since there's no 5.0/5.1 compatible way to fix these (RAILS 5.1 is merged) |
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.
👍 LGTM
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.
LGTM, ui-classic is stilll green.
I guess there's a chance we can still hit some params issues (ManageIQ/manageiq-ui-classic#5076), but currently not seeing any 👍
Oh, correction, specs are passing locally. |
Oh, @jrafanie can you rebase please? |
thanks, I thought I did before court this morning but I rebased the manageiq rails-5-1 branch... ETOOMANYREPOS... I just rebased ui-classi's rails-5-1 test branch... will post here when it is green |
oops, comment is too close to close and comment |
Rails 5.1 switched from julian to gregorian calendar so 1.month and 1.year changed in value. Note, duration_of_report_step consumers should be 30.days and sometimes 1.month, ugh rails/rails#27610 (comment) rails/rails@2a5ae2b Rails PR: #29971
5.1 added new methods for checking changes, specifically in before callbacks. Summary: 5.0 => 5.1 name_changed? => will_save_change_to_name? (before callback) name_changed? => saved_change_to_name? (after callback) A larger table of changes can be found here: rails/rails#25337 (comment) Use latest ancestry with changes for the changed change: https://github.com/stefankroes/ancestry/pull/441/files
Rails pr #26414
This is basically a revert of e83ca32.
Checked commits jrafanie/manageiq@c6329a1~...3b7b50d with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 app/models/chargeback.rb
lib/extensions/ar_migration.rb
|
ok, the test rails 5.1 PR on ui classic is now green after rebasing and force pushing this PR. |
local developers to bundler up and get rails 5.2. Unfortunately, manageiq isn't yet on rails 5.2 so it can't process 5.2 versioned migrations as seen at least once such as ManageIQ#379. ManageIQ/manageiq#18076 is adding rails 5.1 support to manageiq, so let's change schema to 5.1 for now while we work on 5.2 for manageiq.
manageiq isn't yet on rails 5.2 so it can't process 5.2 versioned migrations as seen at least once already, such as ManageIQ#379. ManageIQ/manageiq#18076 is adding rails 5.1 support to manageiq, so let's change schema to 5.1 for now while we work on 5.2 for manageiq.
PR ManageIQ#365 added support for rails 5.1 and 5.2 to schema. Unfortunately, manageiq isn't yet on rails 5.2 so it can't process 5.2 versioned migrations as seen in ManageIQ#379. ManageIQ/manageiq#18076 is adding rails 5.1 support to manageiq, so let's change schema to 5.1 for now while we work on 5.2 for manageiq.
PR ManageIQ#365 added support for rails 5.1 and 5.2 to schema. Unfortunately, manageiq isn't yet on rails 5.2 so it can't process 5.2 versioned migrations as seen in ManageIQ#379. ManageIQ/manageiq#18076 is adding rails 5.1 support to manageiq, so let's change schema to 5.1 for now while we work on 5.2 for manageiq.
Remaining items
Other repos: