brick 1.0.137 → 1.0.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f044e21a6e4c2120a453b6cb3dc404d4d3e3e15034c638d316cbc418bcb996b
|
4
|
+
data.tar.gz: f3360e5e7778bacde155e58bf0683d6b75c74d7dd63d336131e82b0a1865199a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 413c6fe2526752eab0e24998b852e9ae68ef7f56a6488bc14b777e13a4ad281f6c352af465be9e49f05e20fa597e7750d3c706df762f74eb70a18fda5112a319
|
7
|
+
data.tar.gz: cb5040c5333dfa0c0fcbd9d1c04c229e538db1b33fc1526ace987d6da8bd1634e50269e5e05249da6205980ac79c3bad792dd5cc2242115349846365a881bf81
|
data/lib/brick/extensions.rb
CHANGED
@@ -1136,6 +1136,12 @@ Module.class_exec do
|
|
1136
1136
|
plural_class_name == 'BrickGem'
|
1137
1137
|
) ||
|
1138
1138
|
model = self.const_get(full_class_name)
|
1139
|
+
# In the very rare case that we've picked up a MODULE which has the same name as what would be the
|
1140
|
+
# resource's MODEL name, just build out an appropriate auto-model on-the-fly. (RailsDevs code has this in PayCustomer.)
|
1141
|
+
# %%% We don't yet display the code for this new model
|
1142
|
+
if model && !model.is_a?(Class)
|
1143
|
+
model, _code = Object.send(:build_model, relations, model.module_parent, model.module_parent.name, singular_class_name)
|
1144
|
+
end
|
1139
1145
|
# if it's a controller and no match or a model doesn't really use the same table name, eager load all models and try to find a model class of the right name.
|
1140
1146
|
Object.send(:build_controller, self, class_name, plural_class_name, model, relations)
|
1141
1147
|
end
|
@@ -1476,7 +1476,7 @@ end
|
|
1476
1476
|
kls = Object.const_get(::Brick.relations.fetch(r[0], nil)&.fetch(:class_name, nil))
|
1477
1477
|
rescue
|
1478
1478
|
end
|
1479
|
-
kls ? link_to(r[0], send(\"#\{kls._brick_index}_path\".to_sym)) : r[0] %></td>
|
1479
|
+
kls.is_a?(Class) ? link_to(r[0], send(\"#\{kls._brick_index}_path\".to_sym)) : r[0] %></td>
|
1480
1480
|
<td<%= if r[1]
|
1481
1481
|
' class=\"orphan\"' unless ::Brick.relations.key?(r[1])
|
1482
1482
|
else
|
data/lib/brick/version_number.rb
CHANGED