bullet_train-super_scaffolding 1.6.24 → 1.6.26
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/version.rb +1 -1
- data/lib/bullet_train/super_scaffolding.rb +4 -1
- data/lib/generators/super_scaffold/action_models/targets_many/USAGE +30 -0
- data/lib/generators/super_scaffold/action_models/targets_many/targets_many_generator.rb +36 -0
- data/lib/generators/super_scaffold/action_models/targets_one/USAGE +30 -0
- data/lib/generators/super_scaffold/action_models/targets_one/targets_one_generator.rb +36 -0
- data/lib/generators/super_scaffold/action_models/targets_one_parent/USAGE +30 -0
- data/lib/generators/super_scaffold/action_models/targets_one_parent/targets_one_parent_generator.rb +36 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb26f713401ff12ab74cfc0480e6b0e57dd8334debf6f824ac8f00227532b9e
|
4
|
+
data.tar.gz: 33aa464fe25e64843756e785b066e4d4bccaab552e4da4786c407c8166bba727
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5befd985be72b9a36d2fb09e43a91d24f4574c8d98e79bb4ca29b9726d17bfa978b122a68d0406bfd175eea5345428cfcaf6ea8fb13dbbe7b1678f437e836ff5
|
7
|
+
data.tar.gz: e8007183b85fec77997825deaa112fa0af3b81289d0b5334ea44f2cfe17535a4db03e83a8ba79aeff67d3ce8ca859d038e6fb620c22f6181d273c52b9525a319
|
@@ -17,7 +17,10 @@ module BulletTrain
|
|
17
17
|
"crud" => "BulletTrain::SuperScaffolding::Scaffolders::CrudScaffolder",
|
18
18
|
"crud-field" => "BulletTrain::SuperScaffolding::Scaffolders::CrudFieldScaffolder",
|
19
19
|
"join-model" => "BulletTrain::SuperScaffolding::Scaffolders::JoinModelScaffolder",
|
20
|
-
"oauth-provider" => "BulletTrain::SuperScaffolding::Scaffolders::OauthProviderScaffolder"
|
20
|
+
"oauth-provider" => "BulletTrain::SuperScaffolding::Scaffolders::OauthProviderScaffolder",
|
21
|
+
"action-models:targets-many" => "BulletTrain::ActionModels::Scaffolders::TargetsManyScaffolder",
|
22
|
+
"action-models:targets-one" => "BulletTrain::ActionModels::Scaffolders::TargetsOneScaffolder",
|
23
|
+
"action-models:targets-one-parent" => "BulletTrain::ActionModels::Scaffolders::TargetsOneParentScaffolder"
|
21
24
|
}
|
22
25
|
|
23
26
|
class Runner
|
@@ -0,0 +1,30 @@
|
|
1
|
+
Description:
|
2
|
+
Generate an action that targets many models.
|
3
|
+
|
4
|
+
Example:
|
5
|
+
E.g. Perform an Archive action that targets many Projects on a Team.
|
6
|
+
rails generate super_scaffold:action_models:targets_many Archive Project Team
|
7
|
+
|
8
|
+
This will create:
|
9
|
+
app/avo/resources/projects_archive_action.rb
|
10
|
+
app/controllers/account/projects/
|
11
|
+
app/controllers/api/v1/projects/
|
12
|
+
app/controllers/avo/projects_archive_actions_controller.rb
|
13
|
+
app/models/projects.rb
|
14
|
+
app/models/projects/
|
15
|
+
app/views/account/projects/archive_actions/
|
16
|
+
app/views/api/v1/projects/archive_actions/
|
17
|
+
config/locales/en/projects/
|
18
|
+
db/migrate/20240109055956_create_projects_archive_actions.rb
|
19
|
+
test/controllers/api/v1/projects/
|
20
|
+
test/factories/projects/
|
21
|
+
test/models/projects/
|
22
|
+
And update:
|
23
|
+
app/models/team.rb
|
24
|
+
app/views/account/projects/_index.html.erb
|
25
|
+
config/models/roles.yml
|
26
|
+
config/routes.rb
|
27
|
+
config/routes/api/v1.rb
|
28
|
+
|
29
|
+
🏆 Protip: Commit your other changes before running Super Scaffolding so it's easy to undo if you (or we) make any mistakes.
|
30
|
+
If you do that, you can reset to your last commit state by using `git checkout .` and `git clean -d -f`.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative "../../super_scaffold_base"
|
2
|
+
require "scaffolding/routes_file_manipulator"
|
3
|
+
|
4
|
+
module ActionModels
|
5
|
+
class TargetsManyGenerator < Rails::Generators::Base
|
6
|
+
include SuperScaffoldBase
|
7
|
+
|
8
|
+
source_root File.expand_path("templates", __dir__)
|
9
|
+
|
10
|
+
namespace "super_scaffold:action_models:targets_many"
|
11
|
+
|
12
|
+
argument :action_model
|
13
|
+
argument :target_model
|
14
|
+
argument :parent_model
|
15
|
+
|
16
|
+
class_option :skip_migration_generation, type: :boolean, default: false, desc: "Don't generate the model migration"
|
17
|
+
class_option :skip_form, type: :boolean, default: false, desc: "Don't alter the new/edit form"
|
18
|
+
class_option :skip_show, type: :boolean, default: false, desc: "Don't alter the show view"
|
19
|
+
class_option :skip_table, type: :boolean, default: false, desc: "Only add to the new/edit form and show view."
|
20
|
+
class_option :skip_locales, type: :boolean, default: false, desc: "Don't alter locale files"
|
21
|
+
class_option :skip_api, type: :boolean, default: false, desc: "Don't alter the api payloads"
|
22
|
+
class_option :skip_model, type: :boolean, default: false, desc: "Don't alter the model file"
|
23
|
+
|
24
|
+
def generate
|
25
|
+
if defined?(BulletTrain::ActionModels)
|
26
|
+
# We add the name of the specific super_scaffolding command that we want to
|
27
|
+
# invoke to the beginning of the argument string.
|
28
|
+
ARGV.unshift "action-models:targets-many"
|
29
|
+
BulletTrain::SuperScaffolding::Runner.new.run
|
30
|
+
else
|
31
|
+
puts "You must have Action Models installed if you want to use this generator.".red
|
32
|
+
puts "Please refer to the documentation for more information: https://bullettrain.co/docs/action-models"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
Description:
|
2
|
+
Generate an action that targets one model.
|
3
|
+
|
4
|
+
Example:
|
5
|
+
E.g. Perform a schedulable action named Publish for one Listing.
|
6
|
+
rails generate super_scaffold:action_models:targets_one Publish Listing Team
|
7
|
+
|
8
|
+
This will create:
|
9
|
+
app/avo/resources/listings_publish_action.rb
|
10
|
+
app/controllers/account/listings/
|
11
|
+
app/controllers/api/v1/listings/
|
12
|
+
app/controllers/avo/listings_publish_actions_controller.rb
|
13
|
+
app/models/listings.rb
|
14
|
+
app/models/listings/
|
15
|
+
app/views/account/listings/publish_actions/
|
16
|
+
app/views/api/v1/listings/publish_actions/
|
17
|
+
config/locales/en/listings/
|
18
|
+
db/migrate/20240109095227_create_listings_publish_actions.rb
|
19
|
+
test/controllers/api/v1/listings/
|
20
|
+
test/factories/listings/
|
21
|
+
test/models/listings/
|
22
|
+
And update:
|
23
|
+
app/models/listing.rb
|
24
|
+
app/views/account/listings/show.html.erb
|
25
|
+
config/models/roles.yml
|
26
|
+
config/routes.rb
|
27
|
+
config/routes/api/v1.rb
|
28
|
+
|
29
|
+
🏆 Protip: Commit your other changes before running Super Scaffolding so it's easy to undo if you (or we) make any mistakes.
|
30
|
+
If you do that, you can reset to your last commit state by using `git checkout .` and `git clean -d -f`.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative "../../super_scaffold_base"
|
2
|
+
require "scaffolding/routes_file_manipulator"
|
3
|
+
|
4
|
+
module ActionModels
|
5
|
+
class TargetsOneGenerator < Rails::Generators::Base
|
6
|
+
include SuperScaffoldBase
|
7
|
+
|
8
|
+
source_root File.expand_path("templates", __dir__)
|
9
|
+
|
10
|
+
namespace "super_scaffold:action_models:targets_one"
|
11
|
+
|
12
|
+
argument :action_model
|
13
|
+
argument :target_model
|
14
|
+
argument :parent_model
|
15
|
+
|
16
|
+
class_option :skip_migration_generation, type: :boolean, default: false, desc: "Don't generate the model migration"
|
17
|
+
class_option :skip_form, type: :boolean, default: false, desc: "Don't alter the new/edit form"
|
18
|
+
class_option :skip_show, type: :boolean, default: false, desc: "Don't alter the show view"
|
19
|
+
class_option :skip_table, type: :boolean, default: false, desc: "Only add to the new/edit form and show view."
|
20
|
+
class_option :skip_locales, type: :boolean, default: false, desc: "Don't alter locale files"
|
21
|
+
class_option :skip_api, type: :boolean, default: false, desc: "Don't alter the api payloads"
|
22
|
+
class_option :skip_model, type: :boolean, default: false, desc: "Don't alter the model file"
|
23
|
+
|
24
|
+
def generate
|
25
|
+
if defined?(BulletTrain::ActionModels)
|
26
|
+
# We add the name of the specific super_scaffolding command that we want to
|
27
|
+
# invoke to the beginning of the argument string.
|
28
|
+
ARGV.unshift "action-models:targets-one"
|
29
|
+
BulletTrain::SuperScaffolding::Runner.new.run
|
30
|
+
else
|
31
|
+
puts "You must have Action Models installed if you want to use this generator.".red
|
32
|
+
puts "Please refer to the documentation for more information: https://bullettrain.co/docs/action-models"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
Description:
|
2
|
+
Generate an action that processes a model of choice for its parent.
|
3
|
+
|
4
|
+
Example:
|
5
|
+
E.g. Generate a CSV Importer that creates many Listings on a Team.
|
6
|
+
rails generate super_scaffold:action_models:targets_one_parent CsvImport Listing Team
|
7
|
+
|
8
|
+
This will create:
|
9
|
+
app/avo/resources/listings_csv_import_action.rb
|
10
|
+
app/controllers/account/listings/
|
11
|
+
app/controllers/api/v1/listings/
|
12
|
+
app/controllers/avo/listings_csv_import_actions_controller.rb
|
13
|
+
app/models/listings.rb
|
14
|
+
app/models/listings/
|
15
|
+
app/views/account/listings/csv_import_actions/
|
16
|
+
app/views/api/v1/listings/csv_import_actions/
|
17
|
+
config/locales/en/listings/
|
18
|
+
db/migrate/20240109100805_create_listings_csv_import_actions.rb
|
19
|
+
test/controllers/api/v1/listings/
|
20
|
+
test/factories/listings/
|
21
|
+
test/models/listings/
|
22
|
+
And update:
|
23
|
+
app/models/team.rb
|
24
|
+
app/views/account/listings/_index.html.erb
|
25
|
+
config/models/roles.yml
|
26
|
+
config/routes.rb
|
27
|
+
config/routes/api/v1.rb
|
28
|
+
|
29
|
+
🏆 Protip: Commit your other changes before running Super Scaffolding so it's easy to undo if you (or we) make any mistakes.
|
30
|
+
If you do that, you can reset to your last commit state by using `git checkout .` and `git clean -d -f`.
|
data/lib/generators/super_scaffold/action_models/targets_one_parent/targets_one_parent_generator.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative "../../super_scaffold_base"
|
2
|
+
require "scaffolding/routes_file_manipulator"
|
3
|
+
|
4
|
+
module ActionModels
|
5
|
+
class TargetsOneParentGenerator < Rails::Generators::Base
|
6
|
+
include SuperScaffoldBase
|
7
|
+
|
8
|
+
source_root File.expand_path("templates", __dir__)
|
9
|
+
|
10
|
+
namespace "super_scaffold:action_models:targets_one_parent"
|
11
|
+
|
12
|
+
argument :action_model
|
13
|
+
argument :model_to_process
|
14
|
+
argument :target_parent_model
|
15
|
+
|
16
|
+
class_option :skip_migration_generation, type: :boolean, default: false, desc: "Don't generate the model migration"
|
17
|
+
class_option :skip_form, type: :boolean, default: false, desc: "Don't alter the new/edit form"
|
18
|
+
class_option :skip_show, type: :boolean, default: false, desc: "Don't alter the show view"
|
19
|
+
class_option :skip_table, type: :boolean, default: false, desc: "Only add to the new/edit form and show view."
|
20
|
+
class_option :skip_locales, type: :boolean, default: false, desc: "Don't alter locale files"
|
21
|
+
class_option :skip_api, type: :boolean, default: false, desc: "Don't alter the api payloads"
|
22
|
+
class_option :skip_model, type: :boolean, default: false, desc: "Don't alter the model file"
|
23
|
+
|
24
|
+
def generate
|
25
|
+
if defined?(BulletTrain::ActionModels)
|
26
|
+
# We add the name of the specific super_scaffolding command that we want to
|
27
|
+
# invoke to the beginning of the argument string.
|
28
|
+
ARGV.unshift "action-models:targets-one-parent"
|
29
|
+
BulletTrain::SuperScaffolding::Runner.new.run
|
30
|
+
else
|
31
|
+
puts "You must have Action Models installed if you want to use this generator.".red
|
32
|
+
puts "Please refer to the documentation for more information: https://bullettrain.co/docs/action-models"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
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.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|
@@ -164,6 +164,12 @@ files:
|
|
164
164
|
- lib/bullet_train/super_scaffolding/version.rb
|
165
165
|
- lib/bullet_train/terminal_commands.rb
|
166
166
|
- lib/generators/super_scaffold/USAGE
|
167
|
+
- lib/generators/super_scaffold/action_models/targets_many/USAGE
|
168
|
+
- lib/generators/super_scaffold/action_models/targets_many/targets_many_generator.rb
|
169
|
+
- lib/generators/super_scaffold/action_models/targets_one/USAGE
|
170
|
+
- lib/generators/super_scaffold/action_models/targets_one/targets_one_generator.rb
|
171
|
+
- lib/generators/super_scaffold/action_models/targets_one_parent/USAGE
|
172
|
+
- lib/generators/super_scaffold/action_models/targets_one_parent/targets_one_parent_generator.rb
|
167
173
|
- lib/generators/super_scaffold/field/USAGE
|
168
174
|
- lib/generators/super_scaffold/field/field_generator.rb
|
169
175
|
- lib/generators/super_scaffold/incoming_webhooks/USAGE
|