elocal_api_support 1.0.0 → 1.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
  SHA1:
3
- metadata.gz: 10f5150f342e1f031fca95c341585eac74167004
4
- data.tar.gz: 54e5949335ccc7f2bae13e21c5005c6230867753
3
+ metadata.gz: e2f753c8b1ceb13a92c3d6b0e0742f6c628425fb
4
+ data.tar.gz: b6debc2a03050eeac245aa814d5c232004bc35c7
5
5
  SHA512:
6
- metadata.gz: a5c7482e601a47cfe933714a2c282268e79f651a50b721a30cc11bd59ea1fc3f5f16d639382384525b62c2f9146879855bfee00324b04075a8508227772e305c
7
- data.tar.gz: 4433f21de857e3411c6b4656e7de4c63181e4448991f3bed44a011e27f116503dc43f8990062cb973f7a69ea4eac0a54d1d93bfa8c216e15cc29a35a1081898b
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: { errors: lookup_object.errors }, status: 422
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(&:name) - parameters_to_ignore_from_update
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
@@ -1,3 +1,3 @@
1
1
  module ElocalApiSupport
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
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.0.0
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: 2017-04-28 00:00:00.000000000 Z
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.5.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