bullet_train-super_scaffolding 1.6.23 → 1.6.25

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: e3141f9441eacfc60ffddedfc83dfbef489f38c205c5cd19b40e84e7789616ba
4
- data.tar.gz: 1f598d398ef3d77200f8a89424464241ead38e357a037c0f979a079417f8089e
3
+ metadata.gz: 02f2539a50d60d3d08bd3bd2eb3fe3c972860068ee96a7e8d6085c78ed27a491
4
+ data.tar.gz: 0cfad08b3ab92b27e1261d18aa9d41abeec96e32fece397e088f00f79d4202e1
5
5
  SHA512:
6
- metadata.gz: c32f622ab9f4720ac8ade016eca0562032472b9b8cea54064c93a458b6d02c0b86159458b9ebb87f84d475959e4a4ddb58d28e0a96f58608ac57f1342d2debcd
7
- data.tar.gz: d711fccec8a83d6564e4a766f57f7994a212895cb59e1a4bc5981211e3dc1aa842176040175a00c933d28cd6fbc30a2ff2b8551b7f84450297c2ce97d6874d85
6
+ metadata.gz: 485bccdd80226a04a468905ed1b2d746ae8f14a96049b5a435194ae8ec92aaed7cb4ebfa6e93b107fe6cee0bd8fd577940b3c791d3278a623e9df64c75fc58f5
7
+ data.tar.gz: 342f4f04214b6e576c19b455b3defd9e84ad981c6a08680fda94a01b04af0aa29fcc7d21acc6726725dd950e758f45c15f98301a722660537e0ba66a4ef54b3e
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.6.23"
3
+ VERSION = "1.6.25"
4
4
  end
5
5
  end
@@ -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`.
@@ -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.23
4
+ version: 1.6.25
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-12-14 00:00:00.000000000 Z
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