zaikio-hub 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 578ae236058ff3d1e4191cf07f794d361f2234097fee9130f060d6056d52760c
4
- data.tar.gz: 1e4b12ea5289e4735323eeedf06467fffd80753696373929985bd74046ff4c35
3
+ metadata.gz: 4a9640d7936210115f20948864594d3c7d27b27fb0258213c5a3d8733dde9491
4
+ data.tar.gz: 249d78a7f720728047357dd321b721a46f010d6131b21269ed8dd7a81c53a1e2
5
5
  SHA512:
6
- metadata.gz: cd4cc812ec6b153ee9af72774c52f9d64eb38f6d2eb976fe92547c140f1913ece9e65aea1b6f8c7e02c649a54cdf756639ccb71c3e5e2df42dff56a96d2eeabf
7
- data.tar.gz: 171bf01b4ad7bc0a6e1c9b3acb9972d89f2287c795d3e9a401b06786bc3bf8fbb87b07f5c6b95c7410d39300d799de3e88466d5d6b8674f160b85459d66379a5
6
+ metadata.gz: cfc8d23635b8d32c18cf64994aa84be85ba9dc5041ce6eedf3f4904614dfd4444c5e8f60996b311182281cbadd5a975d6934f736a18d74263525722a6d13024e
7
+ data.tar.gz: 6e64d3cbc98a528b6c475485a350f32fd1e0ff6a36cd7831955e45bf7a3bfdb418afaf73502aaef76cb1f0f6debe6bf70f68c06b2eb46cfa70d805061e73e46f
data/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.0] - 2020-02-23
11
+
12
+ ### Changed
13
+
14
+ * Only log Faraday req/response status lines, not headers
15
+ * Added nested attributes for `address_attributes` in `Site`
16
+
10
17
  ## [0.3.0] - 2020-02-12
11
18
 
12
19
  ### Changed
@@ -33,7 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
33
40
  ### Added
34
41
  - Added subscriptions (migration required)
35
42
 
36
- [Unreleased]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.3.0...HEAD
43
+ [Unreleased]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.4.0...HEAD
44
+ [0.4.0]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.3.0...v0.4.0
37
45
  [0.3.0]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.2.0...v.0.3.0
38
46
  [0.2.0]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.1.1...v.0.2.0
39
47
  [0.1.1]: https://github.com/zaikio/zaikio-hub-ruby/compare/5c6cb4dbcac316733560ddb2b1e13b53e55eb66e...v0.1.1
data/lib/zaikio/hub.rb CHANGED
@@ -17,6 +17,7 @@ require "zaikio/hub/person"
17
17
  require "zaikio/hub/machine"
18
18
  require "zaikio/hub/software"
19
19
  require "zaikio/hub/specialist"
20
+ require "zaikio/hub/address"
20
21
  require "zaikio/hub/site"
21
22
  require "zaikio/hub/membership"
22
23
  require "zaikio/hub/current_person"
@@ -68,7 +69,7 @@ module Zaikio
68
69
  self.connection = Faraday.new(url: "#{configuration.host}/api/v1",
69
70
  ssl: { verify: configuration.environment != :test }) do |c|
70
71
  c.request :json
71
- c.response :logger, configuration&.logger
72
+ c.response :logger, configuration&.logger, headers: false
72
73
  c.use JSONParser
73
74
  c.use AuthorizationMiddleware
74
75
  c.use BasicAuthMiddleware
@@ -0,0 +1,12 @@
1
+ module Zaikio
2
+ module Hub
3
+ class Address < Base
4
+ # Attributes
5
+ attributes :addressee, :text, :country_code, :town,
6
+ :street_and_number, :zip_code, :addition
7
+
8
+ # Associations
9
+ belongs_to :site, uri: nil, class_name: "Zaikio::Hub::Site"
10
+ end
11
+ end
12
+ end
@@ -7,6 +7,20 @@ module Zaikio
7
7
  # Attributes
8
8
  attributes :name, :headquarter, :created_at, :updated_at, :address,
9
9
  :address_attributes
10
+
11
+ # Associations
12
+ has_one :address, uri: nil, class_name: "Zaikio::Hub::Address"
13
+
14
+ accepts_nested_attributes_for :address
15
+
16
+ # Callbacks
17
+ before_save :set_address_attributes
18
+
19
+ private
20
+
21
+ def set_address_attributes
22
+ attributes[:address_attributes] = address
23
+ end
10
24
  end
11
25
  end
12
26
  end
@@ -1,5 +1,5 @@
1
1
  module Zaikio
2
2
  module Hub
3
- VERSION = "0.3.0".freeze
3
+ VERSION = "0.4.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaikio-hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - crispymtn
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-02-12 00:00:00.000000000 Z
13
+ date: 2021-02-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: concurrent-ruby
@@ -109,6 +109,7 @@ files:
109
109
  - Rakefile
110
110
  - lib/zaikio/error.rb
111
111
  - lib/zaikio/hub.rb
112
+ - lib/zaikio/hub/address.rb
112
113
  - lib/zaikio/hub/asset.rb
113
114
  - lib/zaikio/hub/authorization_middleware.rb
114
115
  - lib/zaikio/hub/base.rb