bullet_train-super_scaffolding 1.7.18 → 1.7.20

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: 97ac537cf45ae3404149f8cdfc4496d3af7fea1f50a85ae2b65f572ee7fcda35
4
- data.tar.gz: 5e25e6a6bc6040e68a8aad37e322e72d1613ed0fb433393e3fd01808c79d64df
3
+ metadata.gz: 05e9798db04ca5ed9c75d6846c491e5a5f2756c42ff94f67341a64ae65ef1feb
4
+ data.tar.gz: 2f9827f1b4e3c0a323de20204e2bc380c8cac32952cd23c49bfbba2151e4e81a
5
5
  SHA512:
6
- metadata.gz: 7b7049fdb612615b1c6b85b38246539d5c99240308b2ed4c16d0011da3948fb66a40df04a8b95a7ce91c6f479da5bf49e88d7ad838ee6d70f6500d2b67f208ee
7
- data.tar.gz: 54fcfbd4134ed0b3923c2d7c34e6ea727d757a13e03c56a8bf5f6d7def601b2c6f1a29eaaaea026a1d0ddea57921e52332d6c64fbc54c68429bb909ae0915d73
6
+ metadata.gz: 3f1245057bfad657f78178fb3becef1d0d5762fabaa8cf265b668ec7a485bf3a808ab52dae649e26fd0d15292a858d4d918d0e453529b90000567651159e51a3
7
+ data.tar.gz: 73f1a7d20db2b148bad0a305c182611d2ed6e1828f82a11f5ccd3bceb0ba81c8950ee354f0c64cc09ed6f92f8803ffe6786c87e0db7e3486a61c26870d18d611
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.7.18"
3
+ VERSION = "1.7.20"
4
4
  end
5
5
  end
@@ -0,0 +1,17 @@
1
+ Description:
2
+ Generate files needed to add conversations to a model.
3
+
4
+ Example:
5
+ E.g. Add conversations to Posts from a Team.
6
+ rails generate super_scaffold:conversations Post Team
7
+
8
+ This will create:
9
+ db/migrate/20240716162627_add_project_to_conversations.rb
10
+ And update:
11
+ app/models/ability.rb
12
+ app/models/conversation.rb
13
+ app/models/project.rb
14
+ app/views/account/projects/show.html.erb
15
+
16
+ 🏆 Protip: Commit your other changes before running Super Scaffolding so it's easy to undo if you (or we) make any mistakes.
17
+ If you do that, you can reset to your last commit state by using `git checkout .` and `git clean -d -f`.
@@ -0,0 +1,25 @@
1
+ require_relative "../super_scaffold_base"
2
+ require "scaffolding/routes_file_manipulator"
3
+
4
+ class ConversationsGenerator < Rails::Generators::Base
5
+ include SuperScaffoldBase
6
+
7
+ source_root File.expand_path("templates", __dir__)
8
+
9
+ namespace "super_scaffold:conversations"
10
+
11
+ argument :target_model
12
+ argument :parent_model
13
+
14
+ def generate
15
+ if defined?(BulletTrain::Conversations)
16
+ # We add the name of the specific super_scaffolding command that we want to
17
+ # invoke to the beginning of the argument string.
18
+ ARGV.unshift "conversations"
19
+ BulletTrain::SuperScaffolding::Runner.new.run
20
+ else
21
+ puts "You must have Conversations installed if you want to use this generator.".red
22
+ puts "Please refer to the documentation for more information: https://bullettrain.co/docs/conversations"
23
+ end
24
+ end
25
+ end
@@ -717,8 +717,6 @@ class Scaffolding::Transformer
717
717
  if attribute.is_belongs_to?
718
718
  scaffold_add_line_to_file(file_name, "validates :#{attribute.name_without_id}, scope: true", VALIDATIONS_HOOK, prepend: true)
719
719
  end
720
-
721
- # TODO we need to add a multitenancy check for has many associations.
722
720
  end
723
721
 
724
722
  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.7.18
4
+ version: 1.7.20
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-07-15 00:00:00.000000000 Z
11
+ date: 2024-07-23 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/conversations/USAGE
178
+ - lib/generators/super_scaffold/conversations/conversations_generator.rb
177
179
  - lib/generators/super_scaffold/field/USAGE
178
180
  - lib/generators/super_scaffold/field/field_generator.rb
179
181
  - lib/generators/super_scaffold/incoming_webhooks/USAGE