brick 1.0.145 → 1.0.146

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: 4eb70e62d39a7516769b8476c99af1173eb9965d551146a1287fcd615faedf22
4
- data.tar.gz: 3a8f9635d6d7db583df4354a1d0cbde013d7df9ec07101e0b6ffa92bece48134
3
+ metadata.gz: 5a3f6fe9aa20dd0fe9ae7058874432a5966dea3b36f79d1e84702728fb010071
4
+ data.tar.gz: fc6fa3766a3413f9ba4df5cd1d8361bea351a180f6a7950a3ef1f9427145884b
5
5
  SHA512:
6
- metadata.gz: 9faadbd4e71fe53a5deb94424133b701d6db9a64b12323e804385cb1a4df3e68b7a8da1c5d59f14efe2ef5b2e1e20e7543cb427a924f9ae0e41008f5e0a4b75d
7
- data.tar.gz: d296a285cdb3a08482e36d0d1be52bb18709d63aa38677e1887157f88e3a7123b3b6f6e54f50241b915f68d272f30dec5db28b5efd74ae41e099ffca5abc7c89
6
+ metadata.gz: 64f5575cfba4fa0a7983ae4621941a3da6622ed70f606c7c418814d1041a10fec4b522cc0f4741faa6677681a1453b92f0cce31ad36edba9cb0f0c4ca9e812e2
7
+ data.tar.gz: e5aa7fa963d0756a9fa8946daef90f03e1d6e38210811a58c7f901895d44132785222095ea1b3f56223ef663328ecc3536d35a9b8bed6e97fde94edb5f4d5250
@@ -1165,7 +1165,7 @@ erDiagram
1165
1165
  }\\\"\".html_safe %>
1166
1166
  <%= sidelinks(shown_classes, bt_class).html_safe %>
1167
1167
  <% end
1168
- last_through = nil
1168
+ last_hm = nil
1169
1169
  @_brick_hm_counts&.each do |hm|
1170
1170
  # Skip showing self-referencing HM links since they would have already been drawn while evaluating the BT side
1171
1171
  next if (hm_class = hm.last&.klass) == #{@_brick_model.name}
@@ -1174,18 +1174,18 @@ erDiagram
1174
1174
  if (through = hm.last.options[:through]&.to_s) # has_many :through (HMT)
1175
1175
  through_name = (through_assoc = hm.last.source_reflection).active_record.name.split('::').last
1176
1176
  callbacks[through_name] = through_assoc.active_record
1177
- if last_through == through # Same HM, so no need to build it again, and for clarity just put in a blank line
1177
+ if last_hm == through # Same HM, so no need to build it again, and for clarity just put in a blank line
1178
1178
  %><%= \"\n\"
1179
1179
  %><% else
1180
1180
  %> <%= \"#\{model_short_name} ||--o{ #\{through_name}\".html_safe %> : \"\"
1181
1181
  <%= sidelinks(shown_classes, through_assoc.active_record).html_safe %>
1182
- <% last_through = through
1182
+ <% last_hm = through
1183
1183
  end
1184
1184
  %> <%= \"#\{through_name} }o--|| #\{hm_name}\".html_safe %> : \"\"
1185
1185
  <%= \"#\{model_short_name} }o..o{ #\{hm_name} : \\\"#\{hm.first}\\\"\".html_safe %><%
1186
1186
  else # has_many
1187
1187
  %> <%= \"#\{model_short_name} ||--o{ #\{hm_name} : \\\"#\{
1188
- hm.first.to_s unless hm.first.to_s.downcase == hm_class.name.underscore.pluralize.tr('/', '_')
1188
+ hm.first.to_s unless (last_hm = hm.first.to_s).downcase == hm_class.name.underscore.pluralize.tr('/', '_')
1189
1189
  }\\\"\".html_safe %><%
1190
1190
  end %>
1191
1191
  <%= sidelinks(shown_classes, hm_class).html_safe %>
@@ -1846,7 +1846,11 @@ flatpickr(\".timepicker\", {enableTime: true, noCalendar: true});
1846
1846
  var imgErd = document.getElementById(\"imgErd\");
1847
1847
  var mermaidErd = document.getElementById(\"mermaidErd\");
1848
1848
  var mermaidCode;
1849
- var cbs = {<%= callbacks.map { |k, v| \"#\{k}: \\\"#\{send(\"#\{v._brick_index}_path\".to_sym)}\\\"\" }.join(', ').html_safe %>};
1849
+ var cbs = {<%= callbacks.map do |k, v|
1850
+ path = send(\"#\{v._brick_index}_path\".to_sym)
1851
+ path << \"?#\{v.base_class.inheritance_column}=#\{v.name}\" unless v == v.base_class
1852
+ \"#\{k}: \\\"#\{path}\\\"\"
1853
+ end.join(', ').html_safe %>};
1850
1854
  if (imgErd) imgErd.addEventListener(\"click\", showErd);
1851
1855
  function showErd() {
1852
1856
  imgErd.style.display = \"none\";
@@ -5,7 +5,7 @@ module Brick
5
5
  module VERSION
6
6
  MAJOR = 1
7
7
  MINOR = 0
8
- TINY = 145
8
+ TINY = 146
9
9
 
10
10
  # PRE is nil unless it's a pre-release (beta, RC, etc.)
11
11
  PRE = nil
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.145
4
+ version: 1.0.146
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-05-24 00:00:00.000000000 Z
11
+ date: 2023-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord