-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move SerializePositionalToKwargsBridge to the plugin itself
- Loading branch information
Showing
3 changed files
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
lib/manageiq/schema/serialize_positional_to_kwargs_bridge.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module ManageIQ | ||
module Schema | ||
module SerializePositionalToKwargsBridge | ||
def serialize(*args, **options) | ||
return super if Rails.version >= "7.1" | ||
|
||
# For rails 7.0.x, convert 7.1+ kwargs for coder/type into the positional argument | ||
# class_name_or_coder | ||
if options[:coder] | ||
args << options.delete(:coder) | ||
elsif options[:type] | ||
args << options.delete(:type) | ||
end | ||
|
||
super(*args, **options) | ||
end | ||
end | ||
end | ||
end |
19 changes: 0 additions & 19 deletions
19
spec/dummy/config/initializers/serialize_positional_to_kwargs_bridge.rb
This file was deleted.
Oops, something went wrong.