zendesk2 1.3.0 → 1.3.1

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
  SHA1:
3
- metadata.gz: fd8bc936ca004518ab57bb6652a66b093ef1b7a9
4
- data.tar.gz: e575e9c1bef14349397362e5f520e1aed2272403
3
+ metadata.gz: b95ffa24bf712a96c513713ff2391292f4ec0ce2
4
+ data.tar.gz: 32e7be8ce3b6ad0cc881294ef508d0689a482126
5
5
  SHA512:
6
- metadata.gz: a8b7bb9465cffe59e177e56d3ade011c1e328b2143dacb14b7feb85d3ddd0768193d7435a165bccd58156cf8c2e5aa7fb32529661a1b3f42418678ac0b100e08
7
- data.tar.gz: 938dae3498f0937b0884e1e26532e9205e09a8792cbb4bff29d78318573d09f91b3a951ecc1e8d1ddc68c812651c98d142b7aeb4727878812c71ae80a365b69f
6
+ metadata.gz: abdb21b9a7e04733d3144d0e828eed85740a463270a15c6dc8db0c9b91940f0b245ab4f4f3d4857968ee92da819202cbae494cb90a60acbf0b67cb3eaa563597
7
+ data.tar.gz: 1ac672a42025afcb24e7dcbf0c0ac9a88a8ecc2154bc81f624630dbc7cc5ea115195c03bc445429a6613b837e8f4fb7fc7d2c5f2b332d0adbcf0b5d8f785caab
@@ -51,15 +51,17 @@ class Zendesk2::Client
51
51
  requested_custom_fields = (params.delete("custom_fields") || [])
52
52
 
53
53
  custom_fields = requested_custom_fields.map do |cf|
54
- field_id = cf["id"].to_s
55
- if self.data[:ticket_fields][field_id]
54
+ field_id = cf["id"].to_i
55
+ if self.data[:ticket_fields][field_id.to_s]
56
56
  {"id" => field_id, "value" => cf["value"] }
57
+ else
58
+ # @fixme error ?!
57
59
  end
58
60
  end.compact
59
61
 
60
62
  self.data[:ticket_fields].each do |field_id, field|
61
- requested_custom_fields.find { |cf| cf["id"] == field_id.to_s } ||
62
- custom_fields << {"id" => field_id.to_s, "value" => nil }
63
+ requested_custom_fields.find { |cf| cf["id"].to_i == field_id.to_i } ||
64
+ custom_fields << {"id" => field_id.to_i, "value" => nil }
63
65
  end
64
66
 
65
67
  record = {
@@ -1,3 +1,3 @@
1
1
  module Zendesk2
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
data/spec/tickets_spec.rb CHANGED
@@ -135,9 +135,9 @@ describe "Zendesk2::Client" do
135
135
  expect(custom_field["value"]).to be_nil
136
136
 
137
137
  ticket = client.tickets.create!(subject: mock_uuid, description: mock_uuid, custom_fields: [{"id" => ticket_field.identity, "value" => "jessicaspacekat"}])
138
- custom_field = ticket.custom_fields.find { |cf| cf["id"].to_s == ticket_field.identity.to_s }
138
+ custom_field = ticket.custom_fields.find { |cf| cf["id"].to_i == ticket_field.identity.to_i }
139
139
 
140
- expect(custom_field).not_to be_nil
140
+ expect(custom_field).to be
141
141
  expect(custom_field["value"]).to eq("jessicaspacekat")
142
142
 
143
143
  ticket = client.tickets.create!(subject: mock_uuid, description: mock_uuid, custom_fields: [{"id" => "-1", "value" => "fantasy"}])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-29 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable