crudboy 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/crudboy/column.rb +2 -2
- data/lib/crudboy/definition.rb +2 -1
- data/lib/crudboy/template_context.rb +2 -1
- data/lib/crudboy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 866c875982539e7b0bbac41b5032e96fc30652b1a66ea47b5edabaa8c8af36e7
|
4
|
+
data.tar.gz: 3c022bb9a5484b178199aad45c529848e5b7f474b8cb1ee2fa6be7b673e07a71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcffdd76c72073c1da710174f78ba648440b1aa2284ed21f28d7cac757d6a4247f89b83e8748265fc4fd9b87cf9f9d5fc389d2410c1ce111af862ad53a3e83ef
|
7
|
+
data.tar.gz: 876bcc15bcc8eb622a95a4676434bdd568c3af45c11ee353c0cfb2ce11a80b2c85ed52e5244231e56d8f00c143e1f100207177f09daf44a311b72019f567d480
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
crudboy (0.1.
|
4
|
+
crudboy (0.1.6)
|
5
5
|
activerecord (>= 6.0.3, < 6.2.0)
|
6
6
|
activesupport (~> 6.0.3)
|
7
7
|
composite_primary_keys (~> 12.0.3)
|
@@ -53,7 +53,7 @@ GEM
|
|
53
53
|
yard (~> 0.9.11)
|
54
54
|
rainbow (3.0.0)
|
55
55
|
rake (12.3.3)
|
56
|
-
sqlite3 (1.
|
56
|
+
sqlite3 (1.7.3-arm64-darwin)
|
57
57
|
table_print (1.5.7)
|
58
58
|
terminal-table (1.8.0)
|
59
59
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
@@ -65,11 +65,11 @@ GEM
|
|
65
65
|
zeitwerk (2.6.6)
|
66
66
|
|
67
67
|
PLATFORMS
|
68
|
-
|
68
|
+
arm64-darwin-23
|
69
69
|
|
70
70
|
DEPENDENCIES
|
71
71
|
crudboy!
|
72
72
|
rake (~> 12.0)
|
73
73
|
|
74
74
|
BUNDLED WITH
|
75
|
-
2.
|
75
|
+
2.4.1
|
data/lib/crudboy/column.rb
CHANGED
@@ -22,8 +22,8 @@ module Crudboy
|
|
22
22
|
JDBC_TYPES = {
|
23
23
|
"varchar" => 'VARCHAR',
|
24
24
|
"char" => 'CHAR',
|
25
|
-
"text" => '
|
26
|
-
"longtext" => '
|
25
|
+
"text" => 'VARCHAR',
|
26
|
+
"longtext" => 'VARCHAR',
|
27
27
|
"int" => 'INTEGER',
|
28
28
|
"smallint" => 'INTEGER',
|
29
29
|
"bigint" => 'BIGINT',
|
data/lib/crudboy/definition.rb
CHANGED
@@ -59,7 +59,7 @@ module Crudboy
|
|
59
59
|
|
60
60
|
class Definition
|
61
61
|
|
62
|
-
attr_accessor :table_name, :model, :model_name
|
62
|
+
attr_accessor :table_name, :model, :model_name, :table_comment
|
63
63
|
|
64
64
|
def initialize(options)
|
65
65
|
@@options = options
|
@@ -74,6 +74,7 @@ module Crudboy
|
|
74
74
|
raise "Table not exist: #{@table_name}" unless conn.tables.include?(@table_name)
|
75
75
|
|
76
76
|
table_comment = conn.table_comment(@table_name)
|
77
|
+
@table_comment = table_comment
|
77
78
|
conn.primary_key(@table_name).tap do |pkey|
|
78
79
|
Class.new(::CrudboyModel) do
|
79
80
|
include Crudboy::Extension
|
@@ -3,12 +3,13 @@ module Crudboy
|
|
3
3
|
|
4
4
|
include Helper
|
5
5
|
|
6
|
-
attr_accessor :model, :columns, :table_name, :model_name, :bundle_options
|
6
|
+
attr_accessor :model, :columns, :table_name, :table_comment, :model_name, :bundle_options
|
7
7
|
|
8
8
|
def initialize(definition)
|
9
9
|
@model = definition.model
|
10
10
|
@model_name = definition.model_name
|
11
11
|
@table_name = definition.table_name
|
12
|
+
@table_comment = definition.table_comment
|
12
13
|
@columns = @model.columns
|
13
14
|
end
|
14
15
|
|
data/lib/crudboy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crudboy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liu Xiang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|