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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78fc168b87086abdff9a77f6fca18414f48ecfa480b96675e5d57d5b15461834
4
- data.tar.gz: 3a219e7452a7d1cee87498fff9626636758efbd9c6276b38fc8071689271299c
3
+ metadata.gz: a7d33a69bc377b790693e058b4d06a16026a2ecf5f1bbba4ce901062fbedf6ea
4
+ data.tar.gz: 75848676aa75f7e19fb8d52d6310ea7570ea7aa60ae488efab004fb72dfa1870
5
5
  SHA512:
6
- metadata.gz: 86f8893e04227ba822300e981e1a606ccb8242d22c6e3c628fa226b044f50c060dc1a4401b9ae1150bfc9be67718d349d3a8ab23e6c0b12a4d682a8babcd9c00
7
- data.tar.gz: 89ea52f90b89ffde18b3458ccbb20df62848be892c823feb8fe69508b09a46dd451b376e9ec6e298f98dfe6bcfa0d78ff365e292000e470ae1750cd74b684097
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.gsub(/_id$/, "") }
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(" ")}"
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.6.36"
3
+ VERSION = "1.6.37"
4
4
  end
5
5
  end
@@ -90,11 +90,11 @@ class Scaffolding::Attribute
90
90
  end
91
91
 
92
92
  def name_without_id
93
- name.gsub(/_id$/, "")
93
+ name.delete_suffix("_id")
94
94
  end
95
95
 
96
96
  def name_without_ids
97
- name.gsub(/_ids$/, "").pluralize
97
+ name.delete_suffix("_ids").pluralize
98
98
  end
99
99
 
100
100
  def name_without_id_suffix
@@ -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.gsub(/_id$/, "")
133
+ name.delete_suffix("_id")
134
134
  elsif name.match?(/_ids$/)
135
- name.gsub(/_ids$/, "")
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.36
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-08 00:00:00.000000000 Z
11
+ date: 2024-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard