ManageIQ / manageiq

ManageIQ Open-Source Management Platform
https://manageiq.org
Apache License 2.0
1.35k stars 900 forks source link

Use the rails 7.1+ serialize interface #23253

Closed jrafanie closed 1 week ago

jrafanie commented 3 weeks ago

Type was changed from positional to a keyword argument 'type' in 7.1. The positional argument is removed in rails 7.2.

We have a helper bridge module prepending support for either kwargs or positional arguments passed to serialize which converts to positional for rails 7.0 and kwargs for 7.1+. This was added and automatically loaded in the rails app via the engine in schema: https://github.com/ManageIQ/manageiq-schema/pull/756

Extracted from #23225

jrafanie commented 3 weeks ago

Ok, it's failing on a real issue...will mark as wip... interestingly service_mixin referencing service to ensure an object can't be associated with more than one service... note, service is an alias_attribute of parent... this is one of the "problems" in rails 7.1 as alias_attribute doesn't support non-attributes such as parent (an association).

kbrock commented 2 weeks ago

Think these are legit / not too hard to fix:

spec/models/vm_spec.rb:288
spec/models/service_spec.rb:400
spec/models/service_spec.rb:806

assuming it is because a different exception is raised