jsonschema_serializer 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: d65039713e6c37e41ca9c190655625b3d1ab9fc8
4
- data.tar.gz: 204bea0aacdc61d33dedb8894f4f779ef5a63680
3
+ metadata.gz: d1eb0905f97429a33e3a48f272ac469ed4bd674c
4
+ data.tar.gz: e5e879561a2e825f7a55c68046a388e735ca60ff
5
5
  SHA512:
6
- metadata.gz: 494f948e0b3b29bcaef14142952fc580a8de4bf68271a139af6eecf8dcbae99b3d925892734b7199bc8dcc10435600cc81418eb4bebcbcaac4b67d2ef9a322a3
7
- data.tar.gz: 380403b40d52d4e7352a8258f997073900c728391d40f0f536405adbb4214fa9a6920dad3c256d7100f007659cf74456f4ab6577fa992d746094e852bbb51105
6
+ metadata.gz: 332c7b8572a005b88a2fcc81b422deef2fe02c7415b3d18771c2235f7f6b138ce075a7eea28185cf8d9f76f8974c5fe09021f2a9e9a5ef5cc9841350af1c04cd
7
+ data.tar.gz: 9cb94fd3d015da0a8d0cbf5436be5de272cbe3c8334c67b37373fac51a0557b0330e1d0ee81addeb6bc2e85d132ea4e415cd830d3b0be883420c6a29a01e6c64
data/.gitignore CHANGED
@@ -11,5 +11,6 @@
11
11
  .rspec_status
12
12
  .byebug_history
13
13
  .ruby-version
14
+ .gem
14
15
 
15
16
  Gemfile.lock
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ # v 0.0.4 (2018-05-22)
4
+
5
+ - corrected `ActiveRecord::ConnectionAdapters::SqlTypeMetadata` reference in `JsonschemaSerializer::ActiveRecord`
6
+
3
7
  # v 0.0.3 (2018-05-21)
4
8
 
5
9
  - improved documentation on existing code base
@@ -44,7 +44,6 @@ module JsonschemaSerializer
44
44
 
45
45
  # Mapping Ruby types on Jsonschema types.
46
46
  # This could be moved to a separate module later
47
-
48
47
  TYPE_CONVERSIONS = {
49
48
  boolean: :boolean,
50
49
  datetime: :string,
@@ -58,10 +57,15 @@ module JsonschemaSerializer
58
57
  def format_column_element(col)
59
58
  {}.tap do |h|
60
59
  h[:name] = col.name
61
- h[:type] = TYPE_CONVERSIONS[col.type] || :string
60
+ h[:type] = TYPE_CONVERSIONS[sql_type(col)] || :string
62
61
  # col.default.tap { |d| h[:default] = d if d}
63
62
  end
64
63
  end
64
+
65
+ # Format a ActiveRecord::ConnectionAdapters::SqlTypeMetadata as an Hash
66
+ def sql_type(col)
67
+ col.sql_type_metadata.type
68
+ end
65
69
  end
66
70
  end
67
71
  end
@@ -1,3 +1,3 @@
1
1
  module JsonschemaSerializer
2
- VERSION = '0.0.3'.freeze # :nodoc:
2
+ VERSION = '0.0.4'.freeze # :nodoc:
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonschema_serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauro Berlanda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-21 00:00:00.000000000 Z
11
+ date: 2018-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  requirements: []
108
108
  rubyforge_project:
109
- rubygems_version: 2.5.1
109
+ rubygems_version: 2.4.5.4
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: The purpose of this gem is to generate JsonSchema