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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/ncore.rb +1 -0
- data/lib/ncore/base.rb +1 -0
- data/lib/ncore/methods/update_bulk.rb +26 -0
- data/lib/ncore/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dc98407fe99f0886bc4462862fa5141d91be2a92ce6e00845e3770d9d10ffa4
|
4
|
+
data.tar.gz: 756f94ca80ffed714f51ba6822bb30b27e34a270e7bffd1e33c3ac84d2b4d011
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54c04edbf55eaeb2a4100e4dd6fdaf0ce4a4485aa6c0d144bf09f4284bd926cb257e0e1ae9b04a93ead527173a7b5a7f263a36159f7013af5fa8a05dc5032ae6
|
7
|
+
data.tar.gz: ae8e883bb03b9d1d1c18874e69c4719f9ab9420a448f347bd4203ffbce31996fe7a94e0f31714e505cbd06d52177af5a450b36825b23aa79a3bffe15ce053a28
|
data/CHANGELOG.md
CHANGED
@@ -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
|
data/lib/ncore.rb
CHANGED
data/lib/ncore/base.rb
CHANGED
@@ -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
|
data/lib/ncore/version.rb
CHANGED
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
|
+
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-
|
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.
|
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
|