elocal_api_support 1.0.0 → 1.1.0
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 +4 -4
- data/lib/elocal_api_support/actions/update.rb +8 -2
- data/lib/elocal_api_support/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2f753c8b1ceb13a92c3d6b0e0742f6c628425fb
|
4
|
+
data.tar.gz: b6debc2a03050eeac245aa814d5c232004bc35c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4808ee2b392051d75c8a6e1ed8cbd43b7f1e26feece1ecef23101cd8798dafff981a4fe23f01955222a7174a7c05e0d5b31c77ecb760223baeaa6987ac5e7c17
|
7
|
+
data.tar.gz: 457e0c54e05031718aca38d59c4f8e05a8cb5c99235ff3c2aafd6b244c95d2ff78aaa0f6f3ceebe9619d49630f47b85c9d01258d786f93c48a660bd8cd97ebe8
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ElocalApiSupport
|
2
4
|
module Actions
|
3
5
|
module Update
|
@@ -9,7 +11,7 @@ module ElocalApiSupport
|
|
9
11
|
else
|
10
12
|
Rails.logger.info { "There was an issue updating model #{lookup_object}" }
|
11
13
|
Rails.logger.debug { "Error details #{lookup_object.errors.to_xml}" }
|
12
|
-
render json:
|
14
|
+
render json: { errors: lookup_object.errors }, status: 422
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
@@ -20,7 +22,11 @@ module ElocalApiSupport
|
|
20
22
|
end
|
21
23
|
|
22
24
|
def updatable_parameter_names
|
23
|
-
associated_model.columns.map
|
25
|
+
associated_model.columns.map do |col|
|
26
|
+
next if col.name.in?(parameters_to_ignore_from_update)
|
27
|
+
|
28
|
+
col.array ? { col.name => [] } : col.name
|
29
|
+
end
|
24
30
|
end
|
25
31
|
|
26
32
|
def parameters_available_for_update
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elocal_api_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Di Marco
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.
|
162
|
+
rubygems_version: 2.6.12
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: Utilities for controllers when creating a JSON API
|