active_record_api-rest 1.0.36 → 1.0.37
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7798856b80c38b6c12333069047b928704697f4ee287d4e498419959d797c44b
|
4
|
+
data.tar.gz: bbbc6bcd114f7dc9d30d44c1b6ed0b69558d493729190441e468ee76e30a9917
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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
|