introspective_grape 0.5.5 → 0.5.6

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: 9e942af5ab00cc32f0611bfe27ec28ad6dbeb3d5b6f20d847dae3f1dd66cd5d2
4
- data.tar.gz: 489588ff1f420618c18566e111933dab186cdc6d16493ec8a3f17cfad8ece9d6
3
+ metadata.gz: 241e7c16a1bb6c575a8dcf5af51190a9c02057e8a425d3b9df0c7004bd336263
4
+ data.tar.gz: bdb1de6b44a6be36418df88f3e1211969a8a0827a1f0bbc37e82b2b401899b2f
5
5
  SHA512:
6
- metadata.gz: 783bdfd1b17ba6709e2d86146d27e427579051e71de65fb76bebfe4f77ca445093fd03176f6adacf6749accf918ceb9a0a0fbb205ef06329da18535962ad98bd
7
- data.tar.gz: 60bbbbf652648b841091fa37b6494b87a87fe6b72732b0d1f0540ad5b52ec258684b4ccd19bcee99f285b608a73a08f75975e0c6777900774b23d1b1d724e2d5
6
+ metadata.gz: d97473f518ec0abc2dcb61fa9bfa733d988b930ea99f2fd032dade1f0e6d4b50624f9aba110e14ea17598a3a949b47fa9d88f5adc7cb344b0e4e391c09582036
7
+ data.tar.gz: 7a03151630d57796582eef585fe6ed767eb51c0eccd05fd470812c905add8017980552523c78f623844838b32af11f503caf75f94156c88b694c9d715caf01a8
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ 0.5.6 03/09/2022
3
+ ================
4
+
5
+ On the DELETE endpoint the primary key with its type was undeclared, creating conflicts with user-defined delete endpoints.
6
+
2
7
  0.5.5 02/24/2022
3
8
  ================
4
9
 
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.files = `git ls-files`.split("\n").sort
23
23
  s.test_files = `git ls-files -- spec/*`.split("\n")
24
24
 
25
- s.required_ruby_version = '>= 2.5'
25
+ s.required_ruby_version = '> 2.5'
26
26
 
27
27
  s.add_runtime_dependency 'rails', '~> 5.2'
28
28
  s.add_runtime_dependency 'schema_validations'
@@ -99,13 +99,15 @@ module IntrospectiveGrape
99
99
  # As routes are nested keep track of the routes, we are preventing siblings from
100
100
  # appending to the routes array here:
101
101
  routes = build_routes(routes, model)
102
- define_routes(routes, whitelist)
103
102
 
104
103
  # Top level declaration of the Grape::API namespace for the resource:
105
104
  resource routes.first.name.pluralize do
106
- # yield to append additional routes under the root namespace
105
+ # yield to prepend user-defined routes under the root namespace first,
107
106
  yield if block_given?
108
107
  end
108
+
109
+ # Then define IntrospectiveGrape's routes:
110
+ define_routes(routes, whitelist)
109
111
  end
110
112
 
111
113
  def define_routes(routes, api_params)
@@ -209,12 +211,15 @@ module IntrospectiveGrape
209
211
  end
210
212
 
211
213
  # rubocop:enable Metrics/AbcSize
212
- def define_destroy(dsl, routes, _model, _api_params)
214
+ def define_destroy(dsl, routes, model, _api_params)
213
215
  klass = routes.first.klass
214
- name = routes.last.name.singularize
216
+ name = routes.last.name.singularize
215
217
  dsl.desc "destroy a #{name}" do
216
218
  detail klass.destroy_documentation(name)
217
219
  end
220
+ dsl.params do
221
+ requires routes.last.swagger_key, type: klass.param_type(model, model.primary_key)
222
+ end
218
223
  dsl.delete ":#{routes.last.swagger_key}" do
219
224
  authorize @model, :destroy?
220
225
  present status: (klass.find_leaf(routes, @model, params).destroy ? true : false)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IntrospectiveGrape
4
- VERSION = '0.5.5'
4
+ VERSION = '0.5.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: introspective_grape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Buermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-25 00:00:00.000000000 Z
11
+ date: 2022-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -531,7 +531,7 @@ require_paths:
531
531
  - lib
532
532
  required_ruby_version: !ruby/object:Gem::Requirement
533
533
  requirements:
534
- - - ">="
534
+ - - ">"
535
535
  - !ruby/object:Gem::Version
536
536
  version: '2.5'
537
537
  required_rubygems_version: !ruby/object:Gem::Requirement