model_driven_api 3.2.3 → 3.2.4

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: 1b024841871b7a4f4bebfe176a593b84521dce949655a46c47470f7c130330f9
4
- data.tar.gz: d61e7ef935e4beeef85a8668636817aa84e97a7114d6d136c408d20e90ba6523
3
+ metadata.gz: 010f1acfbe42371a8465ba5eeae1f6a5cc0d8c7d5891c30b52ed2c9056bfd7d0
4
+ data.tar.gz: fb81afbec2d0ce91297c68b212a97e213c0b0d7cf15630c82af753f5511ec1f7
5
5
  SHA512:
6
- metadata.gz: 192f347a882bc659fa85ad38fcf00003b36dfc65053914737fea763cc508195bf6a4d8e6f73d5e7f08f6346eb83c76f89f641a5ebee2eaece50da7736af7aaad
7
- data.tar.gz: bacb69b46cdf43d76668a43e28fd0510b65e1e9290b7c348f432c16d1d4c74618555ccde7735a879c0c4dd8fec64c4743fad0e3890715378f100af80fe7ded16
6
+ metadata.gz: '01941ccd88639849a80e1068266b083911915793f0513835e6caf2c61b718d7c4c80d0c57c4a59f25f4a64ddf85a728d18fccada0cf7e53e813b39293b26b339'
7
+ data.tar.gz: e9243797670a8dba2dbd87a2e79571dbb5e39dea8fa26379934a08fe74137db7bb053fc73bbb63d811962397bff5e4cb64c11fdf7b65b5abcfe363827a7185df
@@ -53,7 +53,7 @@ class Api::V2::ApplicationController < ActionController::API
53
53
  end
54
54
 
55
55
  def show
56
- authorize! :show, @record_id
56
+ authorize! :show, @record_id.presence || @model
57
57
 
58
58
  # Custom Show Action
59
59
  status, result, status_number = check_for_custom_action
@@ -66,7 +66,8 @@ class Api::V2::ApplicationController < ActionController::API
66
66
 
67
67
  def create
68
68
  # Normal Create Action
69
- authorize! :create, @record
69
+ Rails.logger.debug("Creating a new record #{@record}")
70
+ authorize! :create, @record.presence || @model
70
71
  # Custom Action
71
72
  status, result, status_number = check_for_custom_action
72
73
  return render json: result, status: (status_number.presence || 200) if status == true
@@ -79,7 +80,7 @@ class Api::V2::ApplicationController < ActionController::API
79
80
  end
80
81
 
81
82
  def update
82
- authorize! :update, @record
83
+ authorize! :update, @record.presence || @model
83
84
 
84
85
  # Custom Action
85
86
  status, result, status_number = check_for_custom_action
@@ -102,7 +103,7 @@ class Api::V2::ApplicationController < ActionController::API
102
103
  end
103
104
 
104
105
  def destroy
105
- authorize! :destroy, @record
106
+ authorize! :destroy, @record.presence || @model
106
107
 
107
108
  # Custom Action
108
109
  status, result, status_number = check_for_custom_action
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.2.3".freeze
2
+ VERSION = "3.2.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.3
4
+ version: 3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-19 00:00:00.000000000 Z
11
+ date: 2024-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_backend_commons