rails_interactive_generators 0.1.0 → 0.1.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f735c0528cb939764ce7e7cfb6014f48b6f1594619598f7f674c7149b80c4a28
|
4
|
+
data.tar.gz: 88da8172e0ef1cb44f018b4cc326f7b01a63bfa95659a636f362ed4a2e4ad60e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59b78451555724d5f8b969efe2c6ce943284bc77bd8859fff8f8527e67e35717d3944e0864f7eee80ce48777ded2154c343621e3f166eeacb9acb875446a33a0
|
7
|
+
data.tar.gz: 765012a4514bbff57b0cc888072a88ccac7c55f714fe4102a12d2208f3552cd01be01b84b538bbb9b61d312decb61b42a7c821721e2464195824ffa3e6e72529
|
data/CHANGELOG.md
CHANGED
@@ -19,6 +19,20 @@ module Interactive
|
|
19
19
|
model_name = prompt.ask("\nWhat is the great name of your model?", required: true) { |q| q.modify :remove }
|
20
20
|
cmd << model_name
|
21
21
|
|
22
|
+
if prompt.select("\nSkip migration?", boolean_choices)
|
23
|
+
cmd << "--no-migration"
|
24
|
+
else
|
25
|
+
cmd += select_columns_configuration
|
26
|
+
cmd << "--no-timestamps" if prompt.select("\nSkip created_at, updated_at timestamps?", boolean_choices)
|
27
|
+
cmd << "--no-indexes" if prompt.select("\nSkip indexes?", boolean_choices)
|
28
|
+
end
|
29
|
+
|
30
|
+
run cmd.join(" ")
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def select_columns_configuration
|
22
36
|
columns = []
|
23
37
|
while prompt.select("\nWould you like to add model attributes(columns)?", boolean_choices)
|
24
38
|
|
@@ -59,12 +73,7 @@ module Interactive
|
|
59
73
|
|
60
74
|
columns << [column_name, column_type, index_option].compact.join(':')
|
61
75
|
end
|
62
|
-
|
63
|
-
|
64
|
-
cmd << "--no-migration" if prompt.select("\nSkip migration?", boolean_choices)
|
65
|
-
cmd << "--no-timestamps" if prompt.select("\nSkip created_at, updated_at timestamps?", boolean_choices)
|
66
|
-
cmd << "--no-indexes" if prompt.select("\nSkip indexes?", boolean_choices)
|
67
|
-
run cmd.join(" ")
|
76
|
+
columns
|
68
77
|
end
|
69
78
|
end
|
70
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_interactive_generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anand Bait
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|