bullet_train-super_scaffolding 1.8.3 → 1.8.4

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: 2a205bbac5111136b98f7af3d1a87f76a1fbd20449e8c8c2329caeed751df896
4
- data.tar.gz: 4707519e317c5b3a605010d528485cd90e44c54566aa201bd35848b0cc6d47ff
3
+ metadata.gz: 9fd34927138c9c4d62670e1cd4db49b074182fdafd559911c7a21614d31d0b99
4
+ data.tar.gz: e210ebe306a8c89bb453dcb6d5d9c732d8a783432a790c5f48c4cc5fe9a33525
5
5
  SHA512:
6
- metadata.gz: f0cd1a2f64f9e7c96f81b950e44089885446f3988cc1e8552b392785464f2a034010c5117e5c26343d5c275143d49eea10756ae266d6cb043c29c7b237af1f3f
7
- data.tar.gz: f7909f319a4ffc2563d5a66cb5ed35c0ee769eb639c671356b34fdd796700ccb34fdfe448aa1b051c6b01f6d1682f450bc18b2ba933e658c96b083d9fd20c479
6
+ metadata.gz: 7d787a123c710490675403e27c0560627d29c031f297252c8a4f3bd051d4968813c58ad2c8001d214d536cab872ed8058efcd38e16f5cb2a3e875a85787c6622
7
+ data.tar.gz: 88c909ec4c12c78e15e93257a87b3d03e26782a81125bc4664723154bdb41afa828d6ec193cd29de174516c5ae9083634dcc5a1bc1c8ec73aeacbc6ec0cfc35f
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.8.3"
3
+ VERSION = "1.8.4"
4
4
  end
5
5
  end
@@ -22,7 +22,8 @@ module BulletTrain
22
22
  "action-models:targets-one" => "BulletTrain::ActionModels::Scaffolders::TargetsOneScaffolder",
23
23
  "action-models:targets-one-parent" => "BulletTrain::ActionModels::Scaffolders::TargetsOneParentScaffolder",
24
24
  "action-models:performs-export" => "BulletTrain::ActionModels::Scaffolders::PerformsExportScaffolder",
25
- "action-models:performs-import" => "BulletTrain::ActionModels::Scaffolders::PerformsImportScaffolder"
25
+ "action-models:performs-import" => "BulletTrain::ActionModels::Scaffolders::PerformsImportScaffolder",
26
+ "audit-logs" => "BulletTrain::AuditLogs::Scaffolders::AuditLogScaffolder"
26
27
  }
27
28
 
28
29
  class Runner
@@ -0,0 +1,22 @@
1
+ Description:
2
+ Generate files needed to add an audit log to a model.
3
+
4
+ Example:
5
+ E.g. Add audit logs to Posts from a Team.
6
+ rails generate super_scaffold:audit_logs Post Team name:text_field
7
+
8
+ The attributes you specify will be added to the _version partial and used to show different versions of the model.
9
+
10
+ This will create:
11
+ db/migrate/20241115152914_add_project_to_activity_versions.rb
12
+ app/views/account/projects/_version.html.erb'.
13
+ And update:
14
+ app/models/project.rb
15
+ app/models/activity/version.rb
16
+ app/views/account/projects/show.html.erb
17
+ app/models/activity/version.rb
18
+ config/routes.rb
19
+ app/controllers/account/projects_controller.rb
20
+
21
+ 🏆 Protip: Commit your other changes before running Super Scaffolding so it's easy to undo if you (or we) make any mistakes.
22
+ If you do that, you can reset to your last commit state by using `git checkout .` and `git clean -d -f`.
@@ -0,0 +1,26 @@
1
+ require_relative "../super_scaffold_base"
2
+ require "scaffolding/routes_file_manipulator"
3
+
4
+ class AuditLogsGenerator < Rails::Generators::Base
5
+ include SuperScaffoldBase
6
+
7
+ source_root File.expand_path("templates", __dir__)
8
+
9
+ namespace "super_scaffold:audit_logs"
10
+
11
+ argument :target_model, type: :string
12
+ argument :parent_model, type: :string
13
+ argument :attributes, type: :array, banner: "attribute:type attribute:type"
14
+
15
+ def generate
16
+ if defined?(BulletTrain::AuditLogs)
17
+ # We add the name of the specific super_scaffolding command that we want to
18
+ # invoke to the beginning of the argument string.
19
+ ARGV.unshift "audit-logs"
20
+ BulletTrain::SuperScaffolding::Runner.new.run
21
+ else
22
+ puts "You must have AuditLogs installed if you want to use this generator.".red
23
+ puts "Please refer to the documentation for more information: https://bullettrain.co/docs/audit-logs"
24
+ end
25
+ end
26
+ 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.8.3
4
+ version: 1.8.4
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-11-14 00:00:00.000000000 Z
11
+ date: 2024-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -174,6 +174,8 @@ files:
174
174
  - lib/generators/super_scaffold/action_models/targets_one/targets_one_generator.rb
175
175
  - lib/generators/super_scaffold/action_models/targets_one_parent/USAGE
176
176
  - lib/generators/super_scaffold/action_models/targets_one_parent/targets_one_parent_generator.rb
177
+ - lib/generators/super_scaffold/audit_logs/USAGE
178
+ - lib/generators/super_scaffold/audit_logs/audit_logs_generator.rb
177
179
  - lib/generators/super_scaffold/conversations/USAGE
178
180
  - lib/generators/super_scaffold/conversations/conversations_generator.rb
179
181
  - lib/generators/super_scaffold/field/USAGE