rails_api_documentation 0.1.3 → 0.1.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
  SHA1:
3
- metadata.gz: b9d56342e45a6d7b01e82bc224038846b82c07be
4
- data.tar.gz: fff285d3cee6a080078ef38b0a2f92e10ec3fd96
3
+ metadata.gz: 92674ef7fe08b55c35b27a5e92c90afedd9cd15f
4
+ data.tar.gz: 55d5ae74861d6d475ffc1848ea8727e378865895
5
5
  SHA512:
6
- metadata.gz: d882032bbbe4b68289e9f0c7941c66e9d713ac9cf64fc72ad1d91477ca344a7e6b2331c09e76a5d30ff0149c59475b9baf2f8a34e5c77510855e5600fef3832d
7
- data.tar.gz: 06bbd056316f3e6f4eae2ed7763dfcdbc12aed2e7af2161d1c300c8df2c9b0dc9a22216e9e3e58a40d4d917fdaad0f583923b97c41c40fbc7ea9196530646648
6
+ metadata.gz: 46978e7b3c973683f12affacdc4ef3dfec94d02a5e3fe4f6819061305f80bab7cb1f5d1062e6ad24cbc44190769c5da44df61d29acc6a42bd67bddd229edb5a4
7
+ data.tar.gz: f630ac4516c07e5fd609f20d7152b7903b53d754b42131bbb14c66ba0943dd3a27f267bfa7061aeeff001c060f617fc9b4436852804f5682172351bd5fb50c5d
@@ -2,6 +2,7 @@ div[href=(model.to_s + '.response') style="--row-count: 3"]
2
2
  - repo.map[model][:actions].each do |action|
3
3
  // TODO: Nest table in this div for easier jq toggling
4
4
  // add borders to this div
5
- div.request-action-title #{repo.action_route(model, action)}
6
- - if data = repo.load_template(model, action)
7
- = render 'shared/response_table', locals: { model: model, rows: data }
5
+ - if route = repo.action_route(model, action)
6
+ div.request-action-title #{repo.action_route(model, action)}
7
+ - if data = repo.load_template(model, action)
8
+ = render 'shared/response_table', locals: { model: model, rows: data }
@@ -29,6 +29,7 @@ class RailsApiDoc::Controller::Response
29
29
 
30
30
  def action_route(ctrl, action)
31
31
  action_route = @map[ctrl][:routes].detect { |r| r.defaults[:action] == action }
32
+ return unless action_route
32
33
  method = action_route.instance_variable_get(:@request_method_match)&.first&.name&.split('::')&.last
33
34
  route = action_route.path.spec.to_s
34
35
  [method, route].compact.join(' ')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  # author: Vadim Shaveiko <@vshaveyko>
3
3
  module RailsApiDoc
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_api_documentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - vs