trogdir_api 0.3.1 → 0.3.2

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: b9f4733cbad415d44505fd19540a4a080940cee7
4
- data.tar.gz: 3914bd626f4a167c7dc917873b08a9811f1d5138
3
+ metadata.gz: 6f57052e725c96965588c538da23263f0789e41a
4
+ data.tar.gz: a77327d98593e4970f533ae727aa9ff510e8b3b5
5
5
  SHA512:
6
- metadata.gz: 6316c0e44791f9eb680df595a9f57455f1a1f78f0d6adb861b08b19b666cfe730b94b4ef55af08a350a5d056120e4cd11c227e1fcb9145b086540ffbae22f3ab
7
- data.tar.gz: a02b8015067152c1d2d9d636a9cb47fb86aafb4c6eb18e11c7bcc7718c97ae56346d1d9930ba5ad532951578f3984a15d6d81c50e681f1f82a6aa4bfdbabd357
6
+ metadata.gz: 24184ee7b339a9e6fe8372dfc6d67e64784f42fb527ede66bf85da84a2e21e8994e72cf8994e731c120ed5293919f63282c91fe4fb6982d4e99c4d1eec0d3b27
7
+ data.tar.gz: a45fa3b89f3e72baea70650320c943f6c180ba8ceb06a73157b06b9d74d5d2b7650442eec8e80097c43add1baacdc636e2faccae70050aa1ed7344f3de41bf03
@@ -1,7 +1,7 @@
1
1
  module Trogdir
2
2
  module V1
3
3
  class AddressEntity < Grape::Entity
4
- expose :id
4
+ expose(:id) { |address| address.id.to_s }
5
5
  expose :type
6
6
  expose :street_1
7
7
  expose :street_2
@@ -11,4 +11,4 @@ module Trogdir
11
11
  expose :country
12
12
  end
13
13
  end
14
- end
14
+ end
@@ -1,10 +1,10 @@
1
1
  module Trogdir
2
2
  module V1
3
3
  class EmailEntity < Grape::Entity
4
- expose :id
4
+ expose(:id) { |email| email.id.to_s }
5
5
  expose :type
6
6
  expose :address
7
7
  expose :primary
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -1,9 +1,9 @@
1
1
  module Trogdir
2
2
  module V1
3
3
  class IDEntity < Grape::Entity
4
- expose :id
4
+ expose(:id) { |id| id.id.to_s }
5
5
  expose :type
6
6
  expose :identifier
7
7
  end
8
8
  end
9
- end
9
+ end
@@ -99,7 +99,10 @@ module Trogdir
99
99
  end
100
100
  end
101
101
  else
102
- hash[field] = object.send(field)
102
+ # BSON::ObjectId#to_json spits out {:$oid=>"5432cb0862757357e4100000"}
103
+ # but we want a simple string like "5432cb0862757357e4100000".
104
+ val = object.send(field)
105
+ hash[field] = val.is_a?(BSON::ObjectId) ? val.to_s : val
103
106
  end
104
107
  end
105
108
  end
@@ -1,10 +1,10 @@
1
1
  module Trogdir
2
2
  module V1
3
3
  class PhoneEntity < Grape::Entity
4
- expose :id
4
+ expose(:id) { |phone| phone.id.to_s }
5
5
  expose :type
6
6
  expose :number
7
7
  expose :primary
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -1,11 +1,11 @@
1
1
  module Trogdir
2
2
  module V1
3
3
  class PhotoEntity < Grape::Entity
4
- expose :id
4
+ expose(:id) { |photo| photo.id.to_s }
5
5
  expose :type
6
6
  expose :url
7
7
  expose :height
8
8
  expose :width
9
9
  end
10
10
  end
11
- end
11
+ end
@@ -1,7 +1,7 @@
1
1
  module Trogdir
2
2
  module V1
3
3
  class SyncLogEntity < Grape::Entity
4
- expose(:sync_log_id) { |sync_log| sync_log.id }
4
+ expose(:sync_log_id) { |sync_log| sync_log.id.to_s }
5
5
  expose :started_at
6
6
  expose :errored_at
7
7
  expose :succeeded_at
@@ -9,4 +9,4 @@ module Trogdir
9
9
  expose :message
10
10
  end
11
11
  end
12
- end
12
+ end
@@ -1,7 +1,7 @@
1
1
  module Trogdir
2
2
  module V1
3
3
  class SyncLogWithChangesetEntity < Grape::Entity
4
- expose(:sync_log_id) { |sync_log| sync_log.id }
4
+ expose(:sync_log_id) { |sync_log| sync_log.id.to_s }
5
5
  expose(:action) { |sync_log| sync_log.changeset.action }
6
6
  expose(:person_id) { |sync_log| sync_log.changeset.person.uuid }
7
7
  expose(:affiliations) { |sync_log| sync_log.changeset.person.affiliations }
@@ -11,4 +11,4 @@ module Trogdir
11
11
  expose(:created_at) { |sync_log| sync_log.changeset.created_at }
12
12
  end
13
13
  end
14
- end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module TrogdirAPI
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trogdir_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Crownoble
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-04 00:00:00.000000000 Z
11
+ date: 2014-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: api-auth
@@ -189,4 +189,3 @@ signing_key:
189
189
  specification_version: 4
190
190
  summary: Trogdir directory API
191
191
  test_files: []
192
- has_rdoc: