bullet_train-super_scaffolding 1.6.36 → 1.6.38

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: 198851d32bbd22c69dc8a458c4ace8fca717fb39851d3d52a5031adf60a52cb2
4
+ data.tar.gz: 6d62f1e6d2adda33ecbed048511043e32c7af3d587e5e42e24e8255b88083f1e
5
5
  SHA512:
6
- metadata.gz: 86f8893e04227ba822300e981e1a606ccb8242d22c6e3c628fa226b044f50c060dc1a4401b9ae1150bfc9be67718d349d3a8ab23e6c0b12a4d682a8babcd9c00
7
- data.tar.gz: 89ea52f90b89ffde18b3458ccbb20df62848be892c823feb8fe69508b09a46dd451b376e9ec6e298f98dfe6bcfa0d78ff365e292000e470ae1750cd74b684097
6
+ metadata.gz: 4e4d21f2432fa430715dff5164c0b7a3f80d21cfd699438d8a748be9238cdd8ee4f75c3e8742b36d179ccdcb826c75b79b9dddea17e21dffb8ace4179792b5e6
7
+ data.tar.gz: 3db261b162e6570a2176be163f42c918bb50a869ec1295f49e743e91d0ef7e561a7ff1dc049de31bbfeed78c6af4024a46410d76fa5d2ad430a97b20883055c6
@@ -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.38"
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.38
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-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard