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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac980a35fb1f7d35d530a726c170e8d8883dc390
4
- data.tar.gz: '092d642494d8d6b3204bc8861f80ec6fe85189a1'
3
+ metadata.gz: 5fafe0b6239d337d64bd02d187829005b0e092da
4
+ data.tar.gz: 3bb206ad1496788c7cc3b8a48d031aa3786420b0
5
5
  SHA512:
6
- metadata.gz: 32f47be797bb2517014c8e0b435967cb891b0de01979698002f7a374829a10cfb8c76f80dde4722678cf3adf10b527920fdf264f2946791945a59959271e4156
7
- data.tar.gz: cc3e4b31386d680b8750e4edb4a88707683685a1ae39b9a80d0e67d7c80366738add60b8f1498680821ff130ddb80ef619f8e14999f87604512b7278eee56b08
6
+ metadata.gz: f10261d6463c7eb6a6a905535898c5d17d190c2f31b32dbce6398d4a62e124ac0513330bd333e7b2277d2245ac3fddd20e59358139c893d12810c212b289ce39
7
+ data.tar.gz: c2214b5e2205465eff5ca816acac794ddd963ac9715114a82bf18732b718aae2834d568202438916fed49fdb00f5ad076a033e680e43a430d37f23779d6c17e1
@@ -1,3 +1,3 @@
1
1
  module JsonApiToolbox
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
data/lib/renderizable.rb CHANGED
@@ -26,7 +26,8 @@ module JsonApiToolbox
26
26
  end
27
27
 
28
28
  def permitted_params
29
- parsed_params = params.permit(permitted_attributes).to_h
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,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_api_toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adriano Bacha