ncore 3.0.0 → 3.1.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: 63b5e71f6a7f803b1a270e81b5f443f41490274387873395dbcc9c05a5cdcca2
4
- data.tar.gz: 875e34f54fd4ba0e014c91ab371be8b6d1202e908cd6470b11666e12e82577b8
3
+ metadata.gz: 5dc98407fe99f0886bc4462862fa5141d91be2a92ce6e00845e3770d9d10ffa4
4
+ data.tar.gz: 756f94ca80ffed714f51ba6822bb30b27e34a270e7bffd1e33c3ac84d2b4d011
5
5
  SHA512:
6
- metadata.gz: 06c85c6685ae41485761e725fb370688846df1b38e5097cf60222f97c7040f2b94f74d250fb37efdc8feff8dbe3b15ca8e366ff2c9f87204de36bea395ee5d2a
7
- data.tar.gz: f5ae351e39942821b41e95a6ae17baa9536696a806847c98e693f3526345c999ef42b9babee6b25fcbae5cf79efdaebd4341c14f01f4c91c6251b8a8320c7155
6
+ metadata.gz: 54c04edbf55eaeb2a4100e4dd6fdaf0ce4a4485aa6c0d144bf09f4284bd926cb257e0e1ae9b04a93ead527173a7b5a7f263a36159f7013af5fa8a05dc5032ae6
7
+ data.tar.gz: ae8e883bb03b9d1d1c18874e69c4719f9ab9420a448f347bd4203ffbce31996fe7a94e0f31714e505cbd06d52177af5a450b36825b23aa79a3bffe15ce053a28
@@ -1,3 +1,7 @@
1
+ #### 3.1.0
2
+
3
+ - Add .bulk_update and bulk_update!
4
+
1
5
  #### 3.0.0
2
6
 
3
7
  BREAKING CHANGES
@@ -35,6 +39,10 @@ Other changes
35
39
  - #i18n_scope, config via Api.i18n_scope=
36
40
  - #cache_key, #cache_version, #cache_key_with_version
37
41
 
42
+ #### 2.2.2
43
+
44
+ - Update certs
45
+
38
46
  #### 2.2.1
39
47
 
40
48
  - Fix decimal attributes on Ruby <= 2.5.x
@@ -33,6 +33,7 @@ end
33
33
  find
34
34
  find_single
35
35
  update
36
+ update_bulk
36
37
  ).each do |f|
37
38
  require "ncore/methods/#{f}"
38
39
  end
@@ -23,6 +23,7 @@ module NCore
23
23
  include DeleteBulk if types.include? :delete_bulk
24
24
  include Find if types.include? :find
25
25
  include Update if types.include? :update
26
+ include UpdateBulk if types.include? :update_bulk
26
27
  end
27
28
 
28
29
  def resource_path
@@ -0,0 +1,26 @@
1
+ module NCore
2
+ module UpdateBulk
3
+ extend ActiveSupport::Concern
4
+
5
+ module ClassMethods
6
+ def bulk_update!(ids, params={})
7
+ raise(module_parent::RecordNotFound, "ids must not be empty") if ids.blank?
8
+ params = parse_request_params(params, json_root: json_root)
9
+ params[:ids] = ids
10
+ parsed, creds = request(:put, resource_path, params)
11
+ if parsed[:errors].any?
12
+ raise module_parent::BulkActionError, parsed[:errors]
13
+ else
14
+ parsed[:metadata]
15
+ end
16
+ end
17
+
18
+ def bulk_update(ids, params={})
19
+ bulk_update!(ids, params)
20
+ rescue module_parent::RecordNotFound, module_parent::BulkActionError
21
+ false
22
+ end
23
+ end
24
+
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module NCore
2
- VERSION = '3.0.0'
2
+ VERSION = '3.1.0'
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.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Notioneer Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-22 00:00:00.000000000 Z
11
+ date: 2020-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -113,6 +113,7 @@ files:
113
113
  - lib/ncore/methods/find.rb
114
114
  - lib/ncore/methods/find_single.rb
115
115
  - lib/ncore/methods/update.rb
116
+ - lib/ncore/methods/update_bulk.rb
116
117
  - lib/ncore/rails/action_controller.rb
117
118
  - lib/ncore/rails/active_model.rb
118
119
  - lib/ncore/rails/log_subscriber.rb
@@ -141,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
142
  - !ruby/object:Gem::Version
142
143
  version: '0'
143
144
  requirements: []
144
- rubygems_version: 3.0.6
145
+ rubygems_version: 3.0.8
145
146
  signing_key:
146
147
  specification_version: 4
147
148
  summary: NCore - Gem for building REST API clients