active_record_api-rest 1.0.36 → 1.0.37

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: e40d9d6e3ff56a7a9b09cd4be0a40165ca94979aee36eaaf1e1e1edbe2d5e4dc
4
- data.tar.gz: 13c1853c0e5a89f17a75e0d8b7714ba55a9da5be2de1dc561850facafb370bdd
3
+ metadata.gz: 7798856b80c38b6c12333069047b928704697f4ee287d4e498419959d797c44b
4
+ data.tar.gz: bbbc6bcd114f7dc9d30d44c1b6ed0b69558d493729190441e468ee76e30a9917
5
5
  SHA512:
6
- metadata.gz: a90df320117e1641e3da9634ca4f5c4c0f1b02d1d3a78c82776384ac8d8ee79a43623d69d992edff2321242977d3b8533ceac2497b7fa8822cedb267ebe86c06
7
- data.tar.gz: 4b52620e92353271454473d48f37835ff809253ab28df111c6463ce1f166a9b4f60f2f061795d46c925b2d3bc9c275f015a3265ce38abb082b22deb75b16ae9b
6
+ metadata.gz: 4c21a4aa700a1646465dfad40a9f3f7e183a318889ad3e1203f1a637b4b51290936184df376bc7e157f584e0a0b22d2e19133d6210a7844efd4d4f4aa09a2caa
7
+ data.tar.gz: ce6e6d0da5c61709181e2af482673c83caed83c6880d09c39d8feec537360dec66310bb82f83828170dbf3ef3494a62a7272fe0da1aec2a4a0fd889c9a74e089
@@ -5,15 +5,15 @@ module ActiveRecordApi
5
5
  attr_accessor :model_klass, :pagination_param_name, :params, :controller_name, :action_name, :additional_valid_params
6
6
 
7
7
  def modifiable_params
8
- @modifiable = params.permit!.to_h.select! { |key, _value| clean(modifiable_names).include?(key.to_sym) }
8
+ @modifiable = params.permit!.to_h.select! { |key, _value| clean(valid_params modifiable_names).include?(key.to_sym) }
9
9
  end
10
10
 
11
11
  def queryable_params
12
- @queryable = params.permit!.to_h.select! { |key, _value| clean(queryable_names).include?(key.to_sym) }
12
+ @queryable = params.permit!.to_h.select! { |key, _value| clean(valid_params queryable_names).include?(key.to_sym) }
13
13
  end
14
14
 
15
- def valid_params
16
- base_valid_params = queryable_names + ['organization_id'] + [:organization_id]
15
+ def valid_params(base_params)
16
+ base_valid_params = base_params + ['organization_id'] + [:organization_id]
17
17
  return base_valid_params unless additional_valid_params.is_a?(Array)
18
18
  base_valid_params + additional_valid_params.flatten
19
19
  end
@@ -23,7 +23,7 @@ module ActiveRecordApi
23
23
  end
24
24
 
25
25
  def not_allowed_params
26
- @not_allowed_params ||= clean_request_names - valid_params
26
+ @not_allowed_params ||= clean_request_names - valid_params(queryable_names)
27
27
  end
28
28
 
29
29
  protected
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecordApi
4
4
  module Rest
5
- VERSION = '1.0.36'.freeze
5
+ VERSION = '1.0.37'.freeze
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_api-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.36
4
+ version: 1.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Full Measure Education