apicasso 0.6.6 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 13242e2ac1896a4ae9d05c041ee23b8bc954aaf90732b7ca20d1896841f9f7bb
|
|
4
|
+
data.tar.gz: 24b133086210106ae44cbc466005b3751824917af2539a66abc849c2e885cf9b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3cbf859e001818cfad717b2e1331d946a52f8bcbcebd710a1edf04f2a00ef3defbd9d01977e8ae096dd7ed95829005920bd8481c56f6ee3115d059caa01f3fcc
|
|
7
|
+
data.tar.gz: a603985b883293f34cbfff86960b7101ac29b3bb686d34e2e851125ef58c83accbec278a2b51dcf19126616a354828b5e356e21a1848ab1dda016ab5ad9b98cd
|
|
@@ -355,11 +355,18 @@ module Apicasso
|
|
|
355
355
|
end
|
|
356
356
|
|
|
357
357
|
# Resource's associations definitions
|
|
358
|
-
model.reflect_on_all_associations.
|
|
359
|
-
|
|
358
|
+
model.reflect_on_all_associations.each do |association|
|
|
359
|
+
begin
|
|
360
|
+
inner_name = association.class_name.to_s.classify
|
|
361
|
+
rescue NoMethodError, ActionController::RoutingError
|
|
362
|
+
inner_name = association.name.to_s.classify
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
next if Apicasso.configuration.model_definitions_excluded.include?(inner_name)
|
|
366
|
+
next if association.polymorphic?
|
|
360
367
|
next if ASSOCIATION_EXCLUDED.include?(inner_name)
|
|
361
368
|
inner_klass = begin inner_name.constantize rescue NameError; false end
|
|
362
|
-
swagger_path "/#{model.name.underscore}/{id}/#{association}" do
|
|
369
|
+
swagger_path "/#{model.name.underscore}/{id}/#{association.name}" do
|
|
363
370
|
operation :get do
|
|
364
371
|
key :summary, I18n.t("activerecord.models.#{inner_name.underscore}.index.summary", default: inner_name)
|
|
365
372
|
key :description, I18n.t("activerecord.models.#{inner_name.underscore}.index.description", default: inner_name)
|
|
@@ -2,7 +2,7 @@ module Apicasso
|
|
|
2
2
|
# This class exposes the settable attributes of the gem
|
|
3
3
|
class Configuration
|
|
4
4
|
attr_accessor :origins, :headers, :resource, :credentials, :methods,
|
|
5
|
-
:max_age, :expose, :if, :vary
|
|
5
|
+
:max_age, :expose, :if, :vary, :model_definitions_excluded
|
|
6
6
|
|
|
7
7
|
def initialize
|
|
8
8
|
@origins = nil
|
|
@@ -14,6 +14,7 @@ module Apicasso
|
|
|
14
14
|
@expose = nil
|
|
15
15
|
@if = nil
|
|
16
16
|
@vary = nil
|
|
17
|
+
@model_definitions_excluded = []
|
|
17
18
|
end
|
|
18
19
|
end
|
|
19
20
|
end
|
data/lib/apicasso/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apicasso
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fernando Bellincanta
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-12-
|
|
11
|
+
date: 2018-12-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|