json_api_toolbox 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/json_api_toolbox/version.rb +1 -1
- data/lib/renderizable.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fafe0b6239d337d64bd02d187829005b0e092da
|
4
|
+
data.tar.gz: 3bb206ad1496788c7cc3b8a48d031aa3786420b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f10261d6463c7eb6a6a905535898c5d17d190c2f31b32dbce6398d4a62e124ac0513330bd333e7b2277d2245ac3fddd20e59358139c893d12810c212b289ce39
|
7
|
+
data.tar.gz: c2214b5e2205465eff5ca816acac794ddd963ac9715114a82bf18732b718aae2834d568202438916fed49fdb00f5ad076a033e680e43a430d37f23779d6c17e1
|
data/lib/renderizable.rb
CHANGED
@@ -26,7 +26,8 @@ module JsonApiToolbox
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def permitted_params
|
29
|
-
|
29
|
+
model = controller_name.singularize
|
30
|
+
parsed_params = params.require(model).permit(permitted_attributes).to_h
|
30
31
|
JsonApiToolbox.normalize_post(parsed_params, model_name)
|
31
32
|
end
|
32
33
|
|
@@ -39,12 +40,12 @@ module JsonApiToolbox
|
|
39
40
|
params.merge!(includes: model_relationships)
|
40
41
|
end
|
41
42
|
|
43
|
+
private
|
44
|
+
|
42
45
|
def model_name
|
43
46
|
controller_name.singularize.camelize.constantize
|
44
47
|
end
|
45
48
|
|
46
|
-
private
|
47
|
-
|
48
49
|
def build_line(title, field, message)
|
49
50
|
{
|
50
51
|
title: title,
|