bunny_app 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00eca4966ed34106d628843766d2f00f2e8a53b7611154ade889825d0add544c
4
- data.tar.gz: 6994edecbd4d80b5b0e6dc53e79603629ca7ff85b1cf799f9bb9bab310ba52b1
3
+ metadata.gz: f476e52c3d2d6d610cdafa7f6ccb102c82b3c11206898ef4eaa725b8a751d182
4
+ data.tar.gz: f918f29875935263188eac342da3454d2aa0256f2edfebd18355b073b30a751a
5
5
  SHA512:
6
- metadata.gz: e2f422c3846e990cd2a35bc0b0b7ace22e099228cf54cca3641a3dc8915f3aec1a0681e31a1ff0c2db579e27b422fbffad0305d48eb25373488e024e27284c5d
7
- data.tar.gz: 43a366d65b9f131444e08b7cc1caa9ec6c83a0feb8803e16560d2450d64fbbe406db89030d5781b69c3e602d5ea9b947267b2f4d62d24c59ab3255cc77be452b
6
+ metadata.gz: 7fd7ebd366bd6b22090a5d92f27f369d7c738b03527b438170d4cf92e2ccc440770e43f3f723103639a63be9de983d7f2ffaa61f0aef79d369b7251a414303fc
7
+ data.tar.gz: 80b25b11940980d9fdc48f930b9d08aeaa7ffd3932d621cd0d614b5f9f85208c7017193cbee4233e49ba7954a97600d88fb897fd1797fc24682ff4524bfa56fb
@@ -76,14 +76,19 @@ module BunnyApp
76
76
  def self.update(id: nil, code: nil, **attrs)
77
77
  raise ArgumentError, 'id or code is required' unless id || code
78
78
 
79
+ # When id is the lookup key, code is treated as an attribute to update.
80
+ # When only code is provided, it is the lookup key.
81
+ lookup_code = id ? nil : code
82
+ update_code = id ? code : attrs[:code]
83
+
79
84
  attributes = {
80
85
  name: attrs[:name],
81
- code: attrs[:code],
86
+ code: update_code,
82
87
  subdomain: attrs[:subdomain],
83
88
  lastLogin: attrs[:last_login]
84
89
  }.compact
85
90
 
86
- variables = { id:, code:, attributes: }
91
+ variables = { id:, code: lookup_code, attributes: }
87
92
 
88
93
  res = Client.new.query(@tenant_update_mutation, variables)
89
94
  raise ResponseError, res['data']['tenantUpdate']['errors'].join(',') if res['data']['tenantUpdate']['errors']
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BunnyApp
4
- VERSION = '2.5.0'
4
+ VERSION = '2.6.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bunny