fast_schema_dumper 0.4.1 → 0.4.2
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 +4 -4
- data/README.md +1 -1
- data/lib/fast_schema_dumper/fast_dumper.rb +8 -0
- data/lib/fast_schema_dumper/version.rb +3 -1
- metadata +15 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dfd997d65329c763b3d9a2947bc4729bf705353b670ed92e3c6aeeb4e5a57274
|
|
4
|
+
data.tar.gz: 3997c70bf8503357745c8ade27fd29d07853ab45bf9f992171102f9b5e79baed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d1182a9edbe7099fcb22c9d40cb0548e6a261d2e1239e840d5f5e9bf96d44f7c23d2014ad534a561fca2e4b28fc0b309b9025cc4571d19581c932f6014e5e43
|
|
7
|
+
data.tar.gz: a6007f94ad89cfd25efe63ad78037a9aa8cfc861e547c90fea76e4453321025dc1ab0c5acd960b67a5376aac17da738bb47840e15fe6de509b442c0371dee477
|
data/README.md
CHANGED
|
@@ -46,7 +46,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
46
46
|
|
|
47
47
|
## Contributing
|
|
48
48
|
|
|
49
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
49
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/smartbank-inc/fast_schema_dumper.
|
|
50
50
|
|
|
51
51
|
## Releasing
|
|
52
52
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require 'json'
|
|
2
|
+
require 'bigdecimal'
|
|
2
3
|
|
|
3
4
|
module FastSchemaDumper
|
|
4
5
|
class SchemaDumper
|
|
@@ -486,6 +487,13 @@ module FastSchemaDumper
|
|
|
486
487
|
when 'datetime', 'timestamp'
|
|
487
488
|
return '-> { "CURRENT_TIMESTAMP" }' if default == 'CURRENT_TIMESTAMP'
|
|
488
489
|
"\"#{default}\""
|
|
490
|
+
when 'decimal'
|
|
491
|
+
# Same as Rails: activemodel/lib/active_model/type/decimal.rb#type_cast_for_schema
|
|
492
|
+
BigDecimal(default).to_s.inspect
|
|
493
|
+
when 'float', 'double'
|
|
494
|
+
# Same as Rails: activemodel/lib/active_model/type/float.rb#type_cast_for_schema
|
|
495
|
+
# MySQL double is mapped to Type::Float in Rails
|
|
496
|
+
default.to_f.inspect
|
|
489
497
|
when 'json'
|
|
490
498
|
default == "'[]'" ? '[]' : '{}'
|
|
491
499
|
else
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fast_schema_dumper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daisuke Aritomo
|
|
@@ -23,6 +23,20 @@ dependencies:
|
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: bigdecimal
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
26
40
|
email:
|
|
27
41
|
- osyoyu@osyoyu.com
|
|
28
42
|
- over.rye@gmail.com
|