brick 1.0.195 → 1.0.196
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 +4 -4
- data/lib/brick/extensions.rb +3 -7
- data/lib/brick/frameworks/rails/engine.rb +20 -7
- data/lib/brick/frameworks/rails/form_tags.rb +5 -2
- data/lib/brick/version_number.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f5cff29063c150d35653274752bcda0ed44ce462563824f8b8a974dfacc8a81
|
4
|
+
data.tar.gz: 2d26e1e8a62b3a9e69c6a28a37e640fa5c5e0ced28a6527db4b68d2abdfc47f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 150e669bb088db49139311839cbca472317b371d24ab85bc096bea94221331c1f7122b8ed521a9c87691d9ded450d723954c2bd7d833b56fd07f248be5624339
|
7
|
+
data.tar.gz: cf000d92773ce9ec8db6a412e7f4fe642e6e9bc07db9412459931a69ebc7dff7fb41de9d1824d068b9c8568827cdbd1881073f3404b85eab1fc1c5670cd625ff
|
data/lib/brick/extensions.rb
CHANGED
@@ -436,13 +436,9 @@ module ActiveRecord
|
|
436
436
|
order_by = ordering&.each_with_object([]) do |ord_part, s| # %%% If a term is also used as an eqi-condition in the WHERE clause, it can be omitted from ORDER BY
|
437
437
|
case ord_part
|
438
438
|
when String
|
439
|
-
ord_expr =
|
440
|
-
ord_part.gsub('^^^', _br_quoted_name(table_name))
|
441
|
-
else
|
442
|
-
_br_quoted_name(ord_part)
|
443
|
-
end
|
439
|
+
ord_expr = _br_quoted_name(ord_part.gsub('^^^', table_name))
|
444
440
|
s << Arel.sql(ord_expr)
|
445
|
-
order_by_txt&.<<("Arel.sql(#{ord_expr.inspect})")
|
441
|
+
order_by_txt&.<<(ord_expr.index('.') ? "Arel.sql(#{ord_expr.inspect})" : ord_expr)
|
446
442
|
else # Expecting only Symbol
|
447
443
|
ord_part = ord_part.to_s
|
448
444
|
if ord_part[0] == '-' # First char '-' means descending order
|
@@ -1917,7 +1913,7 @@ class Object
|
|
1917
1913
|
cspd.select! { |val| val == "'self'" }
|
1918
1914
|
cspd << style_value
|
1919
1915
|
else
|
1920
|
-
cspd << "'sha256-
|
1916
|
+
cspd << "'sha256-0Vb7j3kDGE3oNfwMpRLClTSCUo/q74bvbt3p6kG/gkM='"
|
1921
1917
|
end
|
1922
1918
|
cspd << 'https://cdn.jsdelivr.net'
|
1923
1919
|
end
|
@@ -940,7 +940,11 @@ tr th a {
|
|
940
940
|
.add-hm-related {
|
941
941
|
float: right;
|
942
942
|
}
|
943
|
-
|
943
|
+
#tblAddCol {
|
944
|
+
position: relative;
|
945
|
+
z-index: 2;
|
946
|
+
border: 2px solid blue;
|
947
|
+
}
|
944
948
|
tr th, tr td {
|
945
949
|
padding: 0.2em 0.5em;
|
946
950
|
}
|
@@ -998,6 +1002,12 @@ a.big-arrow {
|
|
998
1002
|
.right {
|
999
1003
|
text-align: right;
|
1000
1004
|
}
|
1005
|
+
.paddingBottomZero {
|
1006
|
+
padding-bottom: 0px;
|
1007
|
+
}
|
1008
|
+
.paddingTopZero {
|
1009
|
+
padding-top: 0px;
|
1010
|
+
}
|
1001
1011
|
.orphan {
|
1002
1012
|
color: red;
|
1003
1013
|
white-space: nowrap;
|
@@ -1193,18 +1203,18 @@ erDiagram
|
|
1193
1203
|
# Make into a server control with a javascript snippet
|
1194
1204
|
# Have post back go to a common "brick_schema" endpoint, this one for add_column
|
1195
1205
|
"
|
1196
|
-
<table
|
1206
|
+
<table id=\"tblAddCol\"><tr>
|
1197
1207
|
<td rowspan=\"2\">Add<br>Column</td>
|
1198
|
-
<td
|
1208
|
+
<td class=\"paddingBottomZero\">Type</td><td class=\"paddingBottomZero\">Name</td>
|
1199
1209
|
<td rowspan=\"2\"><input type=\"button\" id=\"btnAddCol\" value=\"+\"></td>
|
1200
|
-
</tr><tr><td
|
1210
|
+
</tr><tr><td class=\"paddingTopZero\">
|
1201
1211
|
<select id=\"ddlColType\">
|
1202
1212
|
<option value=\"string\">String</option>
|
1203
1213
|
<option value=\"text\">Text</option>
|
1204
1214
|
<option value=\"integer\">Integer</option>
|
1205
1215
|
<option value=\"bool\">Boolean</option>
|
1206
1216
|
</select></td>
|
1207
|
-
<td
|
1217
|
+
<td class=\"paddingTopZero\"><input id=\"txtColName\"></td>
|
1208
1218
|
</tr></table>
|
1209
1219
|
<script>
|
1210
1220
|
var btnAddCol = document.getElementById(\"btnAddCol\");
|
@@ -1590,9 +1600,12 @@ end %>#{"
|
|
1590
1600
|
<table id=\"resourceName\"><td><h1><%= page_title %></h1></td>
|
1591
1601
|
<% rel = Brick.relations[#{model_name}.table_name]
|
1592
1602
|
if (in_app = rel.fetch(:existing, nil)&.fetch(:show, nil))
|
1593
|
-
|
1603
|
+
begin
|
1604
|
+
in_app = send(\"#\{in_app}_path\", #{pk.is_a?(String) ? "obj.#{pk}" : '[' + pk.map { |pk_part| "obj.#{pk_part}" }.join(', ') + ']' }) if in_app.is_a?(Symbol) %>
|
1594
1605
|
<td><%= link_to(::Brick::Rails::IN_APP.html_safe, in_app) %></td>
|
1595
|
-
<%
|
1606
|
+
<% rescue ActionController::UrlGenerationError
|
1607
|
+
end
|
1608
|
+
end
|
1596
1609
|
|
1597
1610
|
if Object.const_defined?('Avo') && ::Avo.respond_to?(:railtie_namespace) %>
|
1598
1611
|
<td><%= link_to_brick(
|
@@ -47,9 +47,12 @@ module Brick::Rails::FormTags
|
|
47
47
|
"
|
48
48
|
end
|
49
49
|
if rel && show_in_app_button != false && (in_app = rel.fetch(:existing, nil)&.fetch(:index, nil))
|
50
|
-
|
51
|
-
|
50
|
+
begin
|
51
|
+
in_app = send("#{in_app}_path") if in_app.is_a?(Symbol)
|
52
|
+
out << " <td title=\"Show in app\">#{link_to(::Brick::Rails::IN_APP.html_safe, in_app)}</td>
|
52
53
|
"
|
54
|
+
rescue ActionController::UrlGenerationError # Avoid snags like "No route matches {:action=>"index", :controller=>"categories/products"}, missing required keys: [:category_id]"
|
55
|
+
end
|
53
56
|
end
|
54
57
|
if show_avo_button != false && Object.const_defined?('Avo') && ::Avo.respond_to?(:railtie_namespace) && klass.name.exclude?('::')
|
55
58
|
out << "
|
data/lib/brick/version_number.rb
CHANGED