Skip to content

Commit

Permalink
Explicitly pass keyword arguments to load for ruby 3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafanie committed Jan 7, 2022
1 parent 408ebcf commit b92e780
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/inventory_refresh/target.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def initialize(association:, manager_ref:, manager: nil, manager_id: nil, event_

# A Rails recommended interface for deserializing an object
# @return [InventoryRefresh::Target] InventoryRefresh::Target instance
def self.load(*args)
new(*args)
def self.load(**args)
new(**args)
end

# A Rails recommended interface for serializing an object
Expand Down
2 changes: 1 addition & 1 deletion spec/target_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
:options => {:opt1 => "opt1", :opt2 => "opt2"}
}

expect { InventoryRefresh::Target.load(data) }.to raise_error("Provide either :manager or :manager_id argument")
expect { InventoryRefresh::Target.load(**data) }.to raise_error("Provide either :manager or :manager_id argument")
end
end

Expand Down

0 comments on commit b92e780

Please sign in to comment.