rails-domino 0.2.9.2 → 0.2.9.3

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: fed54b60a2214a055f3474738ac23e5401b54a9ee06cb52152f2108c3f67f123
4
- data.tar.gz: 4ee0f470feb5f30d8a06a61473511f1423e0dd29dc193ab47ee5bb843587c97a
3
+ metadata.gz: 9ad8b002c5b3dbc3acaacd130c2aa856a37fd9fadea0d159b0a7153f45f7a362
4
+ data.tar.gz: 5a34dc2bbc0462735e0fd32be3a55c64179dc0f84e811f423fae3a8807eb98cf
5
5
  SHA512:
6
- metadata.gz: 27750f3692d4f2fd445b9ecd24af55a3d869d3efee94bbc878c8af729fcd7615b368443f2795e239a0c58a865784cb7d25558f286d9164f316c63eab834ac06a
7
- data.tar.gz: f0100b431053467725d7b72e32631fb4dd3212d76b5bc6bdd26e01477769f744141a5cbf8fde5ae393ed0704bda47827d77e68b64246b331da541acec8154cf9
6
+ metadata.gz: 386ebca7ab3f1134f0f19d3f804152401358ac1c8cd90cb26295d343c9fd222fb7b9631e9d91fb98c244a69899379616b971f3399c1b37c627c1c3d21ae0c032
7
+ data.tar.gz: b14b99a9ec6750e925748d55c3a98accd60ff885c2e613a8f51fc994198c5ecc2f9caa663f56e1253c059ef09712dc6468b3276f20af52be09c279cebb779257
@@ -48,7 +48,27 @@ module Domino
48
48
  end
49
49
 
50
50
  def column_args
51
- @columns.map { |col| "#{col.name}:#{col.sql_type}" unless col.name == "id" }.compact
51
+ # @columns.map { |col| "#{col.name}:#{col.sql_type}" unless col.name == "id" }.compact
52
+ @columns.map do |col|
53
+ next if col.name == "id"
54
+
55
+ rails_type = map_sql_type(col.sql_type)
56
+ "#{col.name}:#{rails_type}" if rails_type
57
+ end.compact
58
+ end
59
+
60
+ def map_sql_type(sql_type) # rubocop:disable Metrics/MethodLength
61
+ case sql_type
62
+ when /nvarchar|varchar|text/ then "string"
63
+ when /int/ then "integer"
64
+ when /timestamp/ then "datetime"
65
+ when /bool/ then "boolean"
66
+ when /decimal|numeric/ then "decimal"
67
+ when /date/ then "date"
68
+ else
69
+ puts "Warning: unknown SQL type #{sql_type}, skipping."
70
+ nil
71
+ end
52
72
  end
53
73
 
54
74
  def generate_file(type) # rubocop:disable Metrics/MethodLength
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Domino
4
- VERSION = "0.2.9.2"
4
+ VERSION = "0.2.9.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-domino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9.2
4
+ version: 0.2.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - kiebor81