brick 1.0.196 → 1.0.197
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/brick/extensions.rb +3 -3
- data/lib/brick/route_mapper.rb +3 -4
- data/lib/brick/version_number.rb +1 -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: bfd8798f339e1bb363ca73f7b3285cdb32471cbae2c6ff5a500b43db6536840a
|
4
|
+
data.tar.gz: be5744fd98d6323ecb33be2b77f50e9ee5b872bc8356ef4d08372cddab4d9920
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8848e2c6a93a75f454b0b9ebd4712769c39868583fc6d6659548c6eb3818eec12bfb7968580a4c684eab67095fca754553a42bc4b71729b223f79882731ebfd3
|
7
|
+
data.tar.gz: b764da2f667e22e5d02e6f5354e3b4b30164827c5b40647b7fca672038f7435ebe14f32dc22d05c54375a29e94c68d82b61dc590099f9e26f2b4843092861bed
|
data/lib/brick/extensions.rb
CHANGED
@@ -3468,9 +3468,9 @@ module Brick
|
|
3468
3468
|
separator ||= '_'
|
3469
3469
|
res_name = (tbl_name_parts = tbl_name.split('.'))[0..-2].first
|
3470
3470
|
res_name << '.' if res_name
|
3471
|
-
(res_name ||= +'') << (relation
|
3471
|
+
(res_name ||= +'') << (relation ||= ::Brick.relations.fetch(tbl_name, nil))&.fetch(:resource, nil) || tbl_name_parts.last
|
3472
3472
|
|
3473
|
-
res_parts = ((mode == :singular) ?
|
3473
|
+
res_parts = ((mode == :singular) ? tbl_name.singularize : tbl_name).split('.')
|
3474
3474
|
res_parts.shift if ::Brick.apartment_multitenant && res_parts.length > 1 && res_parts.first == ::Brick.apartment_default_tenant
|
3475
3475
|
if (aps = relation&.fetch(:auto_prefixed_schema, nil)) && res_parts.last.start_with?(aps)
|
3476
3476
|
last_part = res_parts.last[aps.length..-1]
|
@@ -3487,7 +3487,7 @@ module Brick
|
|
3487
3487
|
index = index.tr('_', 'x') if separator == 'x'
|
3488
3488
|
# Rails applies an _index suffix to that route when the resource name isn't something plural
|
3489
3489
|
index << '_index' if mode != :singular && separator == '_' &&
|
3490
|
-
index == (path_prefix + [
|
3490
|
+
index == (path_prefix + [relation[:class_name]&.underscore&.tr('/', '_') || '_']).join(separator)
|
3491
3491
|
index
|
3492
3492
|
end
|
3493
3493
|
|
data/lib/brick/route_mapper.rb
CHANGED
@@ -74,7 +74,7 @@ module Brick
|
|
74
74
|
schema_prefix = "#{schema_name}."
|
75
75
|
end
|
76
76
|
|
77
|
-
resource_name = v.fetch(:resource, nil)
|
77
|
+
resource_name = v.fetch(:resource, nil) || k
|
78
78
|
next if !resource_name ||
|
79
79
|
existing_controllers.key?(
|
80
80
|
controller_prefix + (resource_name = "#{schema_prefix&.tr('.', '/')}#{resource_name}".pluralize)
|
@@ -82,7 +82,7 @@ module Brick
|
|
82
82
|
|
83
83
|
object_name = k.split('.').last # Take off any first schema part
|
84
84
|
|
85
|
-
full_schema_prefix = if (
|
85
|
+
full_schema_prefix = if (aps = v.fetch(:auto_prefixed_schema, nil))
|
86
86
|
aps = aps[0..-2] if aps[-1] == '_'
|
87
87
|
(schema_prefix&.dup || +'') << "#{aps}."
|
88
88
|
else
|
@@ -90,7 +90,6 @@ module Brick
|
|
90
90
|
end
|
91
91
|
|
92
92
|
# Track routes being built
|
93
|
-
resource_name = v.fetch(:resource, nil) || k
|
94
93
|
if (class_name = v.fetch(:class_name, nil))
|
95
94
|
if v.key?(:isView)
|
96
95
|
view_class_length = class_name.length if class_name.length > view_class_length
|
@@ -98,7 +97,7 @@ module Brick
|
|
98
97
|
else
|
99
98
|
table_class_length = class_name.length if class_name.length > table_class_length
|
100
99
|
tables
|
101
|
-
end << [class_name, aps, "#{"#{schema_name}/" if schema_name}#{resource_name
|
100
|
+
end << [class_name, aps, "#{"#{schema_name}/" if schema_name}#{resource_name}"]
|
102
101
|
end
|
103
102
|
|
104
103
|
options = {}
|
data/lib/brick/version_number.rb
CHANGED
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.
|
4
|
+
version: 1.0.197
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lorin Thwaits
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|