brick 1.0.45 → 1.0.46

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: 678e1295006174594606dc731cd650afa60d2cc727be08bd416c9503faeb1ca4
4
- data.tar.gz: b00802df45b7e388523b29cfab38feaaaf7c61d057cf509c71a6a08860373b15
3
+ metadata.gz: 1442fb46672a819689a1f15aa16e2dd53647a057ea38948431746d3d8baf66f0
4
+ data.tar.gz: 38d26e09e226d37e87737cba35f76ee3b2413dc4474ac8ecba582297205789aa
5
5
  SHA512:
6
- metadata.gz: 7962bbc61bd43b68062d188ac3565e38f4840d52ca76b4c675e0da55d213104f13e007578658441359323899ed881d10497bb8285384abe42a2d15bd9c26b64b
7
- data.tar.gz: 449e74d3ab9558eed77c89aac5a871927ed0842fc043c910d04d1cca29221508332a7def78940ed67048a29e4384576aa8a176beb117c0bc7ff8a48a87f64af6
6
+ metadata.gz: 8cb9e747cffb1e33f045f07656891b8e17ac4349661f897aa01886bae6fb7c2e4687f1021e04173266ab60cf330ec71f58514aeb670669f30ea8c6dd4140e943
7
+ data.tar.gz: 54166ef84adaeab00c2d6408e9a9a6c5da5998bd278b0db490943d2d8da2701938cdc87a4c40ff65ac2cbe7196a7eb014a4b3b08dfd2ff5aa2ec426af00d38ab
@@ -353,7 +353,6 @@ module ActiveRecord
353
353
  next if bt[2] # Polymorphic?
354
354
 
355
355
  # join_array will receive this relation name when calling #brick_parse_dsl
356
- # binding.pry if bt.length > 2
357
356
  bt_descrip[bt.first] = if bt[1].is_a?(Array)
358
357
  bt[1].each_with_object({}) { |bt_class, s| s[bt_class] = bt_class.brick_parse_dsl(join_array, bt.first, translations, true) }
359
358
  else
@@ -831,13 +830,13 @@ class Object
831
830
  need_fk = "#{assoc_name}_id" != assoc[:fk]
832
831
  end
833
832
  if (inverse = assoc[:inverse])
834
- inverse_assoc_name, _x = _brick_get_hm_assoc_name(relations[inverse_table], inverse)
835
833
  # If it's multitenant with something like: public.____ ...
836
834
  if (it_parts = inverse_table.split('.')).length > 1 &&
837
835
  ::Brick.config.schema_behavior[:multitenant] && Object.const_defined?('Apartment') &&
838
836
  it_parts.first == Apartment.default_schema
839
837
  it_parts.shift # ... then ditch the generic schema name
840
838
  end
839
+ inverse_assoc_name, _x = _brick_get_hm_assoc_name(relations[inverse_table], inverse, it_parts.join('_').singularize)
841
840
  has_ones = ::Brick.config.has_ones&.fetch(it_parts.join('/').singularize.camelize, nil)
842
841
  if has_ones&.key?(singular_inv_assoc_name = ActiveSupport::Inflector.singularize(inverse_assoc_name.tr('.', '_')))
843
842
  inverse_assoc_name = if has_ones[singular_inv_assoc_name]
@@ -1085,9 +1084,9 @@ class Object
1085
1084
  [built_controller, code]
1086
1085
  end
1087
1086
 
1088
- def _brick_get_hm_assoc_name(relation, hm_assoc)
1087
+ def _brick_get_hm_assoc_name(relation, hm_assoc, source = nil)
1089
1088
  if (relation[:hm_counts][hm_assoc[:assoc_name]]&.> 1) &&
1090
- hm_assoc[:alternate_name] != hm_assoc[:inverse][:assoc_name]
1089
+ hm_assoc[:alternate_name] != (source || name.underscore)
1091
1090
  plural = ActiveSupport::Inflector.pluralize(hm_assoc[:alternate_name])
1092
1091
  new_alt_name = (hm_assoc[:alternate_name] == name.underscore) ? "#{hm_assoc[:assoc_name].singularize}_#{plural}" : plural
1093
1092
  # uniq = 1
@@ -218,9 +218,6 @@ table tbody tr.active-row {
218
218
  color: #009879;
219
219
  }
220
220
 
221
- td.val {
222
- display: block;
223
- }
224
221
  a.show-arrow {
225
222
  font-size: 1.5em;
226
223
  text-decoration: none;
@@ -266,7 +263,6 @@ input+svg.revert {
266
263
  background-color: #004998;
267
264
  color: #FFF;
268
265
  }
269
-
270
266
  </style>
271
267
  <% is_includes_dates = nil
272
268
 
@@ -685,7 +681,7 @@ end
685
681
  <%= k %>
686
682
  <% end %>
687
683
  </th>
688
- <td class=\"val\">
684
+ <td>
689
685
  <% dt_pickers = { datetime: 'datetimepicker', timestamp: 'datetimepicker', time: 'timepicker', date: 'datepicker' }
690
686
  if bt
691
687
  html_options = { prompt: \"Select #\{bt_name\}\" }
@@ -5,7 +5,7 @@ module Brick
5
5
  module VERSION
6
6
  MAJOR = 1
7
7
  MINOR = 0
8
- TINY = 45
8
+ TINY = 46
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.45
4
+ version: 1.0.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorin Thwaits
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-12 00:00:00.000000000 Z
11
+ date: 2022-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord