bullet_train-super_scaffolding 1.6.33 → 1.6.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/_index.html.erb +1 -1
- data/app/views/account/scaffolding/completely_concrete/tangible_things/_index.html.erb +1 -1
- data/lib/bullet_train/super_scaffolding/scaffolders/oauth_provider_scaffolder.rb +35 -10
- data/lib/bullet_train/super_scaffolding/version.rb +1 -1
- data/lib/scaffolding/class_names_transformer.rb +13 -0
- data/lib/scaffolding/script.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 044dbfb0828cf00ca12e975d7b49769c555636666e64a16ac4d0fc05db19c4d7
|
4
|
+
data.tar.gz: e77bce7fdde5eb6fd3e5a3598bab8520bcf8c37b21a78de734aed69692d7f132
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5aa17cc571a64107afc56007743dc5c14b5192dc021dee371684fcd21fcd50a3b302fef4e73261979769df0bb652a2fb0b9a9750adc21e219330483e7161b4d1
|
7
|
+
data.tar.gz: 9b4e70dcb0af3243235372a36cd42acd9ea655246829fd927af7ecad450fbd195a64a1b453724d08464e65ec251c694fcf09371f0545e66f27c4bc308c5a873b
|
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
<%# 🚅 super scaffolding will insert new targets one parent action model buttons above this line. %>
|
42
42
|
<%# 🚅 super scaffolding will insert new bulk action model buttons above this line. %>
|
43
|
-
<%= render "shared/bulk_action_select" if creative_concepts.
|
43
|
+
<%= render "shared/bulk_action_select" if creative_concepts.any? %>
|
44
44
|
|
45
45
|
<%= link_to t('global.buttons.back'), [:account, context], class: "#{first_button_primary(:absolutely_abstract_creative_concept)} back" unless hide_back %>
|
46
46
|
<% end %>
|
@@ -51,7 +51,7 @@
|
|
51
51
|
|
52
52
|
<%# 🚅 super scaffolding will insert new targets one parent action model buttons above this line. %>
|
53
53
|
<%# 🚅 super scaffolding will insert new bulk action model buttons above this line. %>
|
54
|
-
<%= render "shared/bulk_action_select" if tangible_things.
|
54
|
+
<%= render "shared/bulk_action_select" if tangible_things.any? %>
|
55
55
|
|
56
56
|
<% unless hide_back %>
|
57
57
|
<%= link_to t('global.buttons.back'), [:account, context], class: "#{first_button_primary(:completely_concrete_tangible_thing)} back" %>
|
@@ -45,16 +45,41 @@ module BulletTrain
|
|
45
45
|
unless File.exist?(oauth_transform_string("./app/models/oauth/stripe_account.rb", options)) &&
|
46
46
|
File.exist?(oauth_transform_string("./app/models/integrations/stripe_installation.rb", options)) &&
|
47
47
|
File.exist?(oauth_transform_string("./app/models/webhooks/incoming/oauth/stripe_account_webhook.rb", options))
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
48
|
+
|
49
|
+
oauth_model_data = {
|
50
|
+
"Oauth::StripeAccount": "rails generate model Oauth::StripeAccount uid:string data:jsonb user:references",
|
51
|
+
"Integrations::StripeInstallation": "rails generate model Integrations::StripeInstallation team:references oauth_stripe_account:references name:string",
|
52
|
+
"Webhooks::Incoming::Oauth::StripeAccountWebhook": "rails generate model Webhooks::Incoming::Oauth::StripeAccountWebhook data:jsonb processed_at:datetime verified_at:datetime oauth_stripe_account:references"
|
53
|
+
}
|
54
|
+
|
55
|
+
# Transform class names and model migrations.
|
56
|
+
transformed_data = {}
|
57
|
+
oauth_model_data.each do |key, value|
|
58
|
+
transformed_data[oauth_transform_string(key.to_s, options)] = oauth_transform_string(value, options)
|
59
|
+
end
|
60
|
+
|
61
|
+
if @options["skip-migration-generation"]
|
62
|
+
undefined_models = transformed_data.keys.each { |key| key.safe_constantize.nil? }
|
63
|
+
if undefined_models.any?
|
64
|
+
puts ""
|
65
|
+
puts "We could not find the following models:".red
|
66
|
+
undefined_models.each { |model| puts " #{model}".red }
|
67
|
+
puts ""
|
68
|
+
puts "🚨 Before doing the actual Super Scaffolding, you'll need to generate the models like so:".red
|
69
|
+
puts ""
|
70
|
+
transformed_data.each { |_, migration| puts " #{migration}".red }
|
71
|
+
puts ""
|
72
|
+
puts "However, don't do the `rake db:migrate` until after you re-run Super Scaffolding, as it will need to update some settings in those migrations.".red
|
73
|
+
puts ""
|
74
|
+
return
|
75
|
+
end
|
76
|
+
else
|
77
|
+
transformed_data.each do |klass, generation_command|
|
78
|
+
puts "Generating #{klass} model with '#{generation_command}'".green
|
79
|
+
generation_thread = Thread.new { `#{generation_command}` }
|
80
|
+
generation_thread.join # Wait for the process to finish.
|
81
|
+
end
|
82
|
+
end
|
58
83
|
end
|
59
84
|
|
60
85
|
icon_name = nil
|
@@ -37,6 +37,19 @@ class Scaffolding::ClassNamesTransformer
|
|
37
37
|
parts.last
|
38
38
|
end
|
39
39
|
|
40
|
+
# "In context" here means all of the parts in a namespace
|
41
|
+
# without reference to the parts that overlap.
|
42
|
+
#
|
43
|
+
# For example:
|
44
|
+
# Returns everything because there is no overlap.
|
45
|
+
# Parent: Team
|
46
|
+
# Child: Projects::Site
|
47
|
+
# Return value: [["Projects", "Site"], ["Team"]]
|
48
|
+
#
|
49
|
+
# Returns the namespaces/classes without the parts that overlap.
|
50
|
+
# Parent: Projects::Site
|
51
|
+
# Child: Projects::Sites::Url
|
52
|
+
# Return value: [["Url"], ["Site"]]
|
40
53
|
def all_parts_in_context
|
41
54
|
working_parts = parts
|
42
55
|
working_parent_parts = parent_parts
|
data/lib/scaffolding/script.rb
CHANGED
@@ -174,7 +174,8 @@ def check_required_options_for_attributes(scaffolding_type, attributes, child, p
|
|
174
174
|
# Generate the models/migrations with the attributes passed.
|
175
175
|
if attributes_to_generate.any?
|
176
176
|
case scaffolding_type
|
177
|
-
# "join-model"
|
177
|
+
# "join-model" and "oauth-provider" are not here because the
|
178
|
+
# `rails g` command is written inline in their own respective scaffolders.
|
178
179
|
when "crud"
|
179
180
|
puts "Generating #{child} model with '#{generation_command}'".green
|
180
181
|
when "crud-field"
|
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.35
|
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
|
+
date: 2024-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|