active-dbml 0.2.4 → 0.2.5

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: 8c3e035fb9fbf2783cffe7222a4675df48bf99a242c2b32a970244c0a6757640
4
- data.tar.gz: c0b9e975256b8fa43b5f692f242423be0132ef8c3d4297be35e29e4509af12a9
3
+ metadata.gz: 12bd9ed40bdbfe316aae38c4f1621973400d962673037489fdfe6364ee43ce1a
4
+ data.tar.gz: bf287cb8da032c1bee1f9679a4179775f520f63b4ba358b014784ffb5c00f0a1
5
5
  SHA512:
6
- metadata.gz: eca3036cced74a86f8df57295d74288af90830b36cf225248c6ed5f697a7dd14eda1f33b04ad9527e010180c05d55ebf74eb42635ae3359a7c65817e2ee16e5a
7
- data.tar.gz: '0378667f33007af8d6d0b961bacfaad68dff98028c32241ae17b4c6ec04829acf42f5fdd37074d3840c78f25bf0ac036b6c25650a0503d382effbf21a54bf4f8'
6
+ metadata.gz: 524482569e3c543781212a64897f63a1bd92287345aeb9272042f48bc9a58f76d83fac9d11a860128613e58eadd9c2d20859a4ac9a75911789f26d8cf696d53f
7
+ data.tar.gz: 27ca499cb33ecd107507dec7fbaa75a1685381770aabef67aa8332e1bf8b9dc73ae4abc8541a309312312f2673ffc091d4a233c3a0915f8928d6ffaba9d39450
@@ -1,5 +1,5 @@
1
1
  module Active
2
2
  module Dbml
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
5
5
  end
data/lib/active/dbml.rb CHANGED
@@ -100,6 +100,7 @@ module Active
100
100
  options = []
101
101
  options.push 'pk' if primary_key.eql?(column.name)
102
102
  options.push 'not null' if !column.null
103
+ options.push "default: '#{column.default}'" if column.default
103
104
  options.push "note: '#{column.comment}'" if column.comment.present?
104
105
  options.push "ref: #{foreign_keys[column.name][:relation_type]} #{foreign_keys[column.name][:destination]}" if foreign_keys.key?(column.name)
105
106
 
@@ -135,7 +136,8 @@ module Active
135
136
  if key.present? && !enums_generated.include?(key)
136
137
  dbml_output << "Enum #{key} {"
137
138
  value.keys.each do |value_key|
138
- dbml_output << " #{value_key}"
139
+ translation = model.human_attribute_name("#{key}.#{value_key}")
140
+ dbml_output << " #{value_key} [note: '#{translation}']"
139
141
  end
140
142
 
141
143
  dbml_output << "}\n"
@@ -151,6 +153,8 @@ module Active
151
153
  return 'boolean'
152
154
  when 'datetime(6)'
153
155
  return 'datetime'
156
+ when 'INTEGER'
157
+ return 'bigint'
154
158
  else
155
159
  return sql_type
156
160
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-dbml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ukmshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-20 00:00:00.000000000 Z
11
+ date: 2023-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails