bullet_train-super_scaffolding 1.6.5 → 1.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bullet_train/super_scaffolding/scaffolders/crud_field_scaffolder.rb +0 -1
- data/lib/bullet_train/super_scaffolding/scaffolders/crud_scaffolder.rb +0 -4
- data/lib/bullet_train/super_scaffolding/scaffolders/join_model_scaffolder.rb +3 -11
- data/lib/bullet_train/super_scaffolding/version.rb +1 -1
- data/lib/scaffolding/routes_file_manipulator.rb +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4daf211d2bdfa4cdfed707713e865468f546e99e33217454a3a344623e323b24
|
4
|
+
data.tar.gz: 73a5b7db62adb169f77eab98ebf2480b23a38eaa26d365c98262b34501e8fff3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1f123b55cd71806b43e84da083b8db0c86e655e26d831937651c20c3be179b0d9190fc46a9f72fcc601441b9dd1984352fc06d5e15d88830971999acdcdf6c5
|
7
|
+
data.tar.gz: 21f3158dbbc7af72e1d6610c93e5daeb96e1c1e9f26882dc2acb57231981e9fc8f534c35e592d502bef9306b8c618a21e8f19bc94df54e43f9a81577766c0829
|
@@ -8,7 +8,6 @@ module BulletTrain
|
|
8
8
|
puts "🚅 usage: bin/super-scaffold crud-field <Model> <attribute:type> <attribute:type> ... [options]"
|
9
9
|
puts ""
|
10
10
|
puts "E.g. add a description and body to Pages:"
|
11
|
-
puts " rails g migration add_description_etc_to_pages description:text body:text"
|
12
11
|
puts " bin/super-scaffold crud-field Page description:text_area body:text_area"
|
13
12
|
puts ""
|
14
13
|
puts "Options:"
|
@@ -8,18 +8,15 @@ module BulletTrain
|
|
8
8
|
puts "🚅 usage: bin/super-scaffold crud <Model> <ParentModel[s]> <attribute:type> <attribute:type> ..."
|
9
9
|
puts ""
|
10
10
|
puts "E.g. a Team has many Sites with some attributes:"
|
11
|
-
puts " rails g model Site team:references name:string url:text"
|
12
11
|
puts " bin/super-scaffold crud Site Team name:text_field url:text_area"
|
13
12
|
puts ""
|
14
13
|
puts "E.g. a Section belongs to a Page, which belongs to a Site, which belongs to a Team:"
|
15
|
-
puts " rails g model Section page:references title:string body:text"
|
16
14
|
puts " bin/super-scaffold crud Section Page,Site,Team title:text_field body:text_area"
|
17
15
|
puts ""
|
18
16
|
puts "E.g. an Image belongs to either a Page or a Site:"
|
19
17
|
puts " Doable! See https://bit.ly/2NvO8El for a step by step guide."
|
20
18
|
puts ""
|
21
19
|
puts "E.g. Pages belong to a Site and are sortable via drag-and-drop:"
|
22
|
-
puts " rails g model Page site:references name:string path:text"
|
23
20
|
puts " bin/super-scaffold crud Page Site,Team name:text_field path:text_area --sortable"
|
24
21
|
puts ""
|
25
22
|
puts "🏆 Protip: Commit your other changes before running Super Scaffolding so it's easy to undo if you (or we) make any mistakes."
|
@@ -83,7 +80,6 @@ module BulletTrain
|
|
83
80
|
unless parents.include?("Team")
|
84
81
|
raise "Parents for #{child} should trace back to the Team model, but Team wasn't provided. Please confirm that all of the parents tracing back to the Team model are present and try again.\n" \
|
85
82
|
"E.g.:\n" \
|
86
|
-
"rails g model Section page:references title:text body:text\n" \
|
87
83
|
"bin/super-scaffold crud Section Page,Site,Team title:text body:text\n"
|
88
84
|
end
|
89
85
|
|
@@ -11,29 +11,21 @@ module BulletTrain
|
|
11
11
|
puts ""
|
12
12
|
puts " Given the following example models:".blue
|
13
13
|
puts ""
|
14
|
-
puts " rails g model Project team:references name:string description:text"
|
15
14
|
puts " bin/super-scaffold crud Project Team name:text_field description:trix_editor"
|
16
15
|
puts ""
|
17
|
-
puts " rails g model Projects::Tag team:references name:string"
|
18
16
|
puts " bin/super-scaffold crud Projects::Tag Team name:text_field"
|
19
17
|
puts ""
|
20
|
-
puts " 1️⃣
|
21
|
-
puts ""
|
22
|
-
puts " rails g model Projects::AppliedTag project:references tag:references"
|
23
|
-
puts ""
|
24
|
-
puts " 👋 Don't run migrations yet! Sometimes Super Scaffolding updates them for you.".yellow
|
25
|
-
puts ""
|
26
|
-
puts " 2️⃣ Use `join-model` scaffolding to prepare the join model for use in `crud-field` scaffolding:".blue
|
18
|
+
puts " 1️⃣ Use `join-model` scaffolding to generate the join model for use in `crud-field` scaffolding:".blue
|
27
19
|
puts ""
|
28
20
|
puts " bin/super-scaffold join-model Projects::AppliedTag project_id{class_name=Project} tag_id{class_name=Projects::Tag}"
|
29
21
|
puts ""
|
30
|
-
puts "
|
22
|
+
puts " 2️⃣ Now you can use `crud-field` scaffolding to actually add the field to the form of the parent model:".blue
|
31
23
|
puts ""
|
32
24
|
puts " bin/super-scaffold crud-field Project tag_ids:super_select{class_name=Projects::Tag}"
|
33
25
|
puts ""
|
34
26
|
puts " 👋 Heads up! There will be one follow-up step output by this command that you need to take action on."
|
35
27
|
puts ""
|
36
|
-
puts "
|
28
|
+
puts " 3️⃣ Now you can run your migrations.".blue
|
37
29
|
exit
|
38
30
|
end
|
39
31
|
|
@@ -227,8 +227,8 @@ class Scaffolding::RoutesFileManipulator
|
|
227
227
|
# Finds namespace blocks no matter how many levels deep they are nested in resource blocks, etc.
|
228
228
|
# However, will not find namespace blocks inside namespace blocks.
|
229
229
|
def top_level_namespace_block_lines(within)
|
230
|
-
namespaces = @msmn.method_calls(
|
231
|
-
namespace_line_numbers = namespaces.map
|
230
|
+
namespaces = @msmn.method_calls(token_value: "namespace")
|
231
|
+
namespace_line_numbers = namespaces.map(&:line_number)
|
232
232
|
|
233
233
|
local_namespace_blocks = []
|
234
234
|
Scaffolding::FileManipulator.lines_within(lines, within).each do |line|
|
@@ -239,7 +239,7 @@ class Scaffolding::RoutesFileManipulator
|
|
239
239
|
# all other namespace blocks INSIDE the top-level namespace blocks are skipped
|
240
240
|
if namespace_line_numbers.include?(line_index)
|
241
241
|
# Grab the first symbol token on the same line as the namespace.
|
242
|
-
namespace_name = @msmn.symbols.find { |sym| sym
|
242
|
+
namespace_name = @msmn.symbols.find { |sym| sym.line_number == line_index }.token_value
|
243
243
|
local_namespace = find_namespaces([namespace_name], within)
|
244
244
|
starting_line_number = local_namespace[namespace_name]
|
245
245
|
local_namespace_block = ((starting_line_number + 1)..(Scaffolding::BlockManipulator.find_block_end(starting_from: starting_line_number, lines: lines) + 1))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-super_scaffolding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 2.0.2
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 2.0.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: indefinite_article
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|