oas_rails 0.8.3 → 0.9.0

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: e9ec1769321b530eaf7d00f96827ac3062c4b7ba7a63eb88586bddf67d70dc56
4
- data.tar.gz: d61cc8aaf523c8d260ffaf1e6d68810e9e68d275874fbbcc30cea8150f5f4b41
3
+ metadata.gz: 0e873607a5e36e6301251d74b2754c71d0c2b2e3591afcc7f4d3c8135be4f1c3
4
+ data.tar.gz: e3f242451e51b13bc2b05b00ab9e5c440f8a139914ec567e6547fa14f8a6c09e
5
5
  SHA512:
6
- metadata.gz: 61da9b7abe2bdb8012c9a3c338820f208e73e386174c9e6903eaa01fc572adfb5caa825e273364a487dfd3638f8e8f75db710518dc0d4b391fd6f3dad997ec82
7
- data.tar.gz: fc78d7790e5d584f12476baab723c97b74d704850f959db09e9e0c516d8b18bb621b7b0dcd0e1af43d919101c933ceccfcbaf8cdf886eff70aea46b1a36964e8
6
+ metadata.gz: 66c4beb422b09cc0c801433897f892a7e52284fefbfd5598220e893d3ebdf6a026c68d54613cf4c7ab920e6cc320ba7f331ae1bc4c9dd9f4002df9d41183e79f
7
+ data.tar.gz: 60faac4dfba6f28e9ac45f4c37f1879b3bd5a4136baee262ee0a950fb824128047f514cda2845623b64be3bccf5a6407234060846882f7a1033e4720a56afc52
@@ -13,3 +13,7 @@
13
13
  allow-spec-file-download="true"
14
14
  >
15
15
  </rapi-doc>
16
+
17
+ <style>
18
+ rapi-doc::part(btn btn-outline){ width: 220px; min-width: 170px; }
19
+ </style>
@@ -33,7 +33,7 @@ module OasRails
33
33
  end
34
34
 
35
35
  def from_model_class(klass)
36
- return self unless klass.ancestors.include? ActiveRecord::Base
36
+ return self unless klass.ancestors.map(&:to_s).include? 'ActiveRecord::Base'
37
37
 
38
38
  model_schema = Builders::EsquemaBuilder.send("build_#{@context}_schema", klass:)
39
39
  model_schema["required"] = []
@@ -18,7 +18,7 @@ module OasRails
18
18
  end
19
19
 
20
20
  def from_tags(tag:, examples_tags: [])
21
- if tag.klass.ancestors.include? ActiveRecord::Base
21
+ if tag.klass.ancestors.map(&:to_s).include? 'ActiveRecord::Base'
22
22
  from_model_class(klass: tag.klass, description: tag.text, required: tag.required, examples_tags:)
23
23
  else
24
24
  @request_body.description = tag.text
@@ -60,7 +60,7 @@ module OasRails
60
60
  maybe_a_model, errors = content.gsub('@', "").split(".")
61
61
  klass = maybe_a_model.singularize.camelize(:upper).constantize
62
62
 
63
- if klass.ancestors.include?(ActiveRecord::Base)
63
+ if klass.ancestors.map(&:to_s).include? 'ActiveRecord::Base'
64
64
  schema = Builders::EsquemaBuilder.build_outgoing_schema(klass:)
65
65
  if test_singularity(maybe_a_model)
66
66
  build_singular_model_schema_and_examples(maybe_a_model, errors, klass, schema)
@@ -1,3 +1,3 @@
1
1
  module OasRails
2
- VERSION = "0.8.3"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -151,7 +151,7 @@ module OasRails
151
151
  # @return [Boolean] True if the text refers to an ActiveRecord class, false otherwise.
152
152
  def active_record_class?(text)
153
153
  klass = text.constantize
154
- klass.ancestors.include? ActiveRecord::Base
154
+ klass.ancestors.map(&:to_s).include? 'ActiveRecord::Base'
155
155
  rescue StandardError
156
156
  false
157
157
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oas_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - a-chacon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-21 00:00:00.000000000 Z
11
+ date: 2025-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source