Skip to content
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

[spaceship] Remove unused params in ConnectAPI::Device #20931

Merged
merged 1 commit into from
Dec 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions spaceship/lib/spaceship/connect_api/models/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def self.all(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
# @param platform [String] The platform of the device.
# @param include_disabled [Bool] Whether to include disable devices. false by default.
# @return (Device) Find a device based on the UDID of the device. nil if no device was found.
def self.find_by_udid(device_udid, client: nil, platform: nil, include_disabled: false)
def self.find_by_udid(device_udid, client: nil, include_disabled: false)
self.all(client: client).find do |device|
device.udid.casecmp(device_udid) == 0 && (include_disabled ? true : device.enabled?)
end
Expand All @@ -70,10 +70,9 @@ def self.find_by_udid(device_udid, client: nil, platform: nil, include_disabled:
# @param client [ConnectAPI] ConnectAPI client.
# @param name [String] The name to be assigned to the device, if it needs to be created.
# @param platform [String] The platform of the device.
# @param include_disabled [Bool] Whether to include disable devices. false by default.
# @return (Device) Find a device based on the UDID of the device. If no device was found, nil if no device was found.
def self.find_or_create(device_udid, client: nil, name: nil, platform: nil, include_disabled: false)
existing = self.find_by_udid(device_udid, client: client, platform: platform)
def self.find_or_create(device_udid, client: nil, name: nil, platform: nil)
existing = self.find_by_udid(device_udid, client: client)
return existing if existing
return self.create(client: client, name: name, platform: platform, udid: device_udid)
end
Expand Down