bullet_train-super_scaffolding 1.6.36 → 1.6.37
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/scaffolders/join_model_scaffolder.rb +1 -1
- data/lib/bullet_train/super_scaffolding/version.rb +1 -1
- data/lib/scaffolding/attribute.rb +2 -2
- data/lib/scaffolding/script.rb +2 -2
- data/lib/tasks/bullet_train/super_scaffolding_tasks.rake +0 -10
- 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: a7d33a69bc377b790693e058b4d06a16026a2ecf5f1bbba4ce901062fbedf6ea
|
4
|
+
data.tar.gz: 75848676aa75f7e19fb8d52d6310ea7570ea7aa60ae488efab004fb72dfa1870
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd629420914dfa91d04f4b7c244a6c37f615c1135c19233743a174ec51e01107806ba2b7eed3b085f5ac32003b11b55fb4d377e256314dcbfd40723362d36609
|
7
|
+
data.tar.gz: 96f3b2a3e70ddf0700d87da31f0098531845ef941260ce8866ec44dd3620e6fb6b3a677baad8e8c2575ff9bf9db73b4b00898cd529cf9ce40343ca3dde5858d3
|
@@ -38,7 +38,7 @@ module BulletTrain
|
|
38
38
|
|
39
39
|
unless @options["skip-migration-generation"]
|
40
40
|
attributes_without_options = attributes.map { |attribute| attribute.gsub(/{.*}$/, "") }
|
41
|
-
attributes_without_id = attributes_without_options.map { |attribute| attribute.
|
41
|
+
attributes_without_id = attributes_without_options.map { |attribute| attribute.delete_suffix("_id") }
|
42
42
|
attributes_with_references = attributes_without_id.map { |attribute| attribute + ":references" }
|
43
43
|
|
44
44
|
generation_command = "bin/rails generate model #{child} #{attributes_with_references.join(" ")}"
|
@@ -90,11 +90,11 @@ class Scaffolding::Attribute
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def name_without_id
|
93
|
-
name.
|
93
|
+
name.delete_suffix("_id")
|
94
94
|
end
|
95
95
|
|
96
96
|
def name_without_ids
|
97
|
-
name.
|
97
|
+
name.delete_suffix("_ids").pluralize
|
98
98
|
end
|
99
99
|
|
100
100
|
def name_without_id_suffix
|
data/lib/scaffolding/script.rb
CHANGED
@@ -130,9 +130,9 @@ def check_required_options_for_attributes(scaffolding_type, attributes, child, p
|
|
130
130
|
attribute_options ||= {}
|
131
131
|
unless attribute_options[:vanilla]
|
132
132
|
name_without_id = if name.match?(/_id$/)
|
133
|
-
name.
|
133
|
+
name.delete_suffix("_id")
|
134
134
|
elsif name.match?(/_ids$/)
|
135
|
-
name.
|
135
|
+
name.delete_suffix("_ids")
|
136
136
|
end
|
137
137
|
|
138
138
|
attribute_options[:class_name] ||= name_without_id.classify
|
@@ -1,12 +1,2 @@
|
|
1
1
|
namespace :bullet_train do
|
2
|
-
desc "Next-level code generation"
|
3
|
-
task :super_scaffolding, [:all_options] => :environment do |t, arguments|
|
4
|
-
ARGV.pop while ARGV.any?
|
5
|
-
|
6
|
-
arguments[:all_options]&.split&.each do |argument|
|
7
|
-
ARGV.push(argument)
|
8
|
-
end
|
9
|
-
|
10
|
-
BulletTrain::SuperScaffolding::Runner.new.run
|
11
|
-
end
|
12
2
|
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.37
|
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-03-
|
11
|
+
date: 2024-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|