brick 1.0.192 → 1.0.194

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: 148c8f46702d06322322c04487a1045e6d7a3927611394a84ffe138be78adb5e
4
- data.tar.gz: 716bfaae50dc99809bc3aee4eecf5ff1c44325bca54271db225a765cdd97fb56
3
+ metadata.gz: 241617832338faa570f73caad241a98dd065fc9e1428fe54801bfbb57a26a392
4
+ data.tar.gz: 86a7427f5b382bc478eec07e42c42eac1f5aeda56e29bad839e947acfec6c08f
5
5
  SHA512:
6
- metadata.gz: d97d94ed8d951718b34d1fc0d3ee8d023b3765bafc759fd41161155c927014ddec54a67e371363bbb17b18a614f4be16862d9cb51be313438050a3ce6e3356a2
7
- data.tar.gz: efbd8b062eccd5d5441aa8e9fe6162bce076e188761f5c7877f9ca454899fc13873fa6cdf4db21cd2154e24c824487f56a085f41402432bd99486e17213e7f00
6
+ metadata.gz: 25392afb2c248e305decfe4c641c415f96f7836c46aeda2bad56b59016ee140c780a008dfa57a563d987ed75c7be929d786d95bfa2f15aa58128f67a043429b7
7
+ data.tar.gz: afc21602ca3c3be41b686534c78b49507f1d1c06a6abe90a224c5302e8ebefaf5963bc75e181b4bd31b7b5eae9fe0970c871f33945ec192fe63bcb4e336b7baa
@@ -5,7 +5,7 @@ module Brick
5
5
  module VERSION
6
6
  MAJOR = 1
7
7
  MINOR = 0
8
- TINY = 192
8
+ TINY = 194
9
9
 
10
10
  # PRE is nil unless it's a pre-release (beta, RC, etc.)
11
11
  PRE = nil
@@ -27,7 +27,7 @@ module Brick
27
27
  model_info = Hash.new { |h, k| h[k] = {} }
28
28
  tableless = Hash.new { |h, k| h[k] = [] }
29
29
  existing_controllers = ActionController::Base.descendants.reject do |c|
30
- c.name.start_with?('Turbo::Native::')
30
+ c.name.nil? || c.name&.start_with?('Turbo::Native::')
31
31
  end.map(&:name)
32
32
  controllers = ::Brick.relations.each_with_object([]) do |rel, s|
33
33
  next if rel.first.is_a?(Symbol)
@@ -59,10 +59,13 @@ module Brick
59
59
  chosen = gets_list(list: controllers, chosen: controllers.dup)
60
60
  relations = ::Brick.relations
61
61
  chosen.each do |controller_option|
62
- if (controller_parts = controller_option.to_s.split('::')).length > 1
63
- namespace = controller_parts.first.constantize
64
- end
65
- _built_controller, code = Object.send(:build_controller, namespace, controller_parts.last, controller_parts.last.pluralize, controller_option.model, relations)
62
+ namespace = if (controller_parts = controller_option.to_s.split('::')).length > 1
63
+ controller_parts.first.constantize
64
+ else
65
+ Object
66
+ end
67
+ controller_parts[controller_parts.length - 1] = (controller_name = "#{controller_parts.last.pluralize}Controller")
68
+ _built_controller, code = Object.send(:build_controller, namespace, controller_name, controller_name, controller_option.model, relations)
66
69
  path = ['controllers']
67
70
  path.concat(controller_parts.map(&:underscore))
68
71
  dir = +"#{::Rails.root}/app"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brick
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.192
4
+ version: 1.0.194
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorin Thwaits
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-26 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord