ncore 3.4.1 → 3.4.2

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: 4ad09fd322d7d12373a6546e276cf7d350c4425b273a864c705fc580c10a269c
4
- data.tar.gz: 6fd560c150a0ef389ac40b989c71f8c092f5d88802a1d35851d2bff06ca44d8c
3
+ metadata.gz: e05865527c77bbb27e9a70c0b880db847160b8904fa7c0693dac8e84be15870f
4
+ data.tar.gz: f10b8e34df3e7a95d2994e533c45d70671f5ea479e585ac7b3ff89f8ceea9226
5
5
  SHA512:
6
- metadata.gz: c33362a9a2553c073d449aa58c97d850763e73b15a08fc34e5cf399c7c0043961ecb371fed29df917235fc482e62f8d1a3f944e05c36292253c65d5f5398d426
7
- data.tar.gz: ebdd0b5a3cf136fbce954bbcda99cd2f0fd8cdeedb52347da76f5acf076aac57865d9bf77cc65fcfcb88a48f3390a9722bb9d8704ed24d20c84c7891f88e4a32
6
+ metadata.gz: 82dbca21c895a10441d08fd7390af765d397966ec90d528f7caf988d8bc9485b5f128ba6c766361c90fbb8eb1ddc47525a7d27366f29e29a3a7dcb552e811b0f
7
+ data.tar.gz: 0f9971e5d56859937c5b21e0dcacdfdeacab3049e327bf727ff28c9e47ec13ee7c36ab7f5b55786924508fb6ccca56187080b79d82bb98019e1eb8c71b0aa60b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ #### 3.4.2
2
+
3
+ - Fix SomeResource.all when payload includes 'data' attribute
4
+
1
5
  #### 3.4.1
2
6
 
3
7
  - Allow ActiveModel 7.0
@@ -84,6 +88,10 @@ Other changes
84
88
  - #i18n_scope, config via Api.i18n_scope=
85
89
  - #cache_key, #cache_version, #cache_key_with_version
86
90
 
91
+ #### 2.3.2
92
+
93
+ - Allow ActiveSupport 7.0
94
+
87
95
  #### 2.3.1
88
96
 
89
97
  - Allow ActiveModel 6.1
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2021 Notioneer, Inc.
1
+ Copyright (c) 2014-2022 Notioneer, Inc.
2
2
 
3
3
  MIT License
4
4
 
@@ -1,7 +1,12 @@
1
1
  module MyApi
2
2
  class Railtie < Rails::Railtie
3
3
 
4
- config.after_initialize do
4
+ config.action_dispatch.rescue_responses.merge!(
5
+ 'MyApi::RecordInvalid' => :unprocessable_entity, # 422
6
+ 'MyApi::RecordNotFound' => :not_found, # 404
7
+ )
8
+
9
+ initializer "my_api.cache_store" do |app|
5
10
  MyApi::Api.cache_store = Rails.cache
6
11
  end
7
12
 
@@ -6,11 +6,12 @@ module NCore
6
6
 
7
7
  private
8
8
 
9
+ # only caches GET requests with 200..299, 409, 422 responses
9
10
  # cache_opts: true
10
11
  # use *::Api.cache_store
11
12
  # cache_opts: {...}
12
13
  # use: *::Api.cache_store, with options: {...}
13
- # hint: add force: true execute the query and rewrite the cache
14
+ # hint: add force: true to execute the query and rewrite the cache
14
15
  # cache_opts: Store.new
15
16
  # use Store.new as-is
16
17
  def execute_request(req, cache_opts=nil)
@@ -12,7 +12,7 @@ module NCore
12
12
  Collection.new.tap do |coll|
13
13
  coll.metadata = parsed[:metadata]
14
14
  parsed[:data].each do |hash|
15
- coll << factory(hash.merge(metadata: parsed[:metadata]), creds)
15
+ coll << factory({data: hash, metadata: parsed[:metadata]}, creds)
16
16
  end
17
17
  end
18
18
  end
data/lib/ncore/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module NCore
2
- VERSION = '3.4.1'
2
+ VERSION = '3.4.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ncore
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.1
4
+ version: 3.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Notioneer Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-20 00:00:00.000000000 Z
11
+ date: 2022-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0'
144
144
  requirements: []
145
- rubygems_version: 3.2.15
145
+ rubygems_version: 3.2.22
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: NCore - Gem for building REST API clients