brick 1.0.44 → 1.0.45

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: 0d43e8d88203f6496d0e86f57a3de2638f254a74da070d6a0f0ae107bf596a87
4
- data.tar.gz: d5ce2e3814f36fa758762e3c4774032c70ce18a101cdd1e30622dd86c757ab1a
3
+ metadata.gz: 678e1295006174594606dc731cd650afa60d2cc727be08bd416c9503faeb1ca4
4
+ data.tar.gz: b00802df45b7e388523b29cfab38feaaaf7c61d057cf509c71a6a08860373b15
5
5
  SHA512:
6
- metadata.gz: 36b8bf590c1d980655b8c465e52659fdbcdf3e13b7050e46dcb41c2b3fba44ebc9ff14db823afddbb49b3e6b736a33fa1ef794ed6062aba4e35ade3cd95c5bbd
7
- data.tar.gz: d1bd0954d0400068aaf8f7c83cc599f283fbe9c75e347fd4193d1fa3973c0d2bd3198f3265990cd3d24f406cd3b55f3174518bd6a991801c75a06d1c749cc157
6
+ metadata.gz: 7962bbc61bd43b68062d188ac3565e38f4840d52ca76b4c675e0da55d213104f13e007578658441359323899ed881d10497bb8285384abe42a2d15bd9c26b64b
7
+ data.tar.gz: 449e74d3ab9558eed77c89aac5a871927ed0842fc043c910d04d1cca29221508332a7def78940ed67048a29e4384576aa8a176beb117c0bc7ff8a48a87f64af6
@@ -274,7 +274,6 @@ module ActiveRecord
274
274
  table = table.left
275
275
  end
276
276
  (_brick_chains[table._arel_table_type] ||= []) << (alias_name || table.table_alias || table.name)
277
- # puts "YES! #{self.object_id}"
278
277
  end
279
278
  # rubocop:enable Style/IdenticalConditionalBranches
280
279
  when Arel::Table # Table
@@ -286,9 +285,9 @@ module ActiveRecord
286
285
  # Spin up an empty set of Brick alias name chains at the start
287
286
  @_brick_chains = {}
288
287
  # The left side is the "FROM" table
289
- # names += _recurse_arel(piece.left)
290
288
  names << (this_name = [piece.left._arel_table_type, (piece.left.table_alias || piece.left.name)])
291
- (_brick_chains[this_name.first] ||= []) << this_name.last
289
+ # # Do not currently need the root "FROM" table in our list of chains
290
+ # (_brick_chains[this_name.first] ||= []) << this_name.last
292
291
  # The right side is an array of all JOINs
293
292
  piece.right.each { |join| names << _recurse_arel(join) }
294
293
  end
@@ -168,10 +168,10 @@ module Brick
168
168
  }
169
169
 
170
170
  #headerTop {
171
- position: sticky;
172
- top: 0px;
173
- background-color: white;
174
- z-index: 1;
171
+ position: sticky;
172
+ top: 0px;
173
+ background-color: white;
174
+ z-index: 1;
175
175
  }
176
176
  table {
177
177
  border-collapse: collapse;
@@ -240,6 +240,10 @@ a.big-arrow {
240
240
  .dimmed {
241
241
  background-color: #C0C0C0;
242
242
  }
243
+ .orphan {
244
+ color: red;
245
+ white-space: nowrap;
246
+ }
243
247
 
244
248
  #revertTemplate {
245
249
  display: none;
@@ -255,13 +259,14 @@ input+svg.revert {
255
259
  top: 0.5em;
256
260
  }
257
261
 
258
- input[type=submit] {
262
+ .update {
263
+ position: sticky;
264
+ right: 1em;
265
+ float: right;
259
266
  background-color: #004998;
260
267
  color: #FFF;
261
268
  }
262
- .right {
263
- text-align: right;
264
- }
269
+
265
270
  </style>
266
271
  <% is_includes_dates = nil
267
272
 
@@ -580,8 +585,8 @@ if (headerTop) {
580
585
  # 0..62 because Postgres column names are limited to 63 characters
581
586
  #{obj_name}, (descrips = @_brick_bt_descrip[bt.first][bt_class])[0..-2].map { |id| #{obj_name}.send(id.last[0..62]) }, (bt_id_col = descrips.last)
582
587
  )
583
- bt_txt ||= \"<< Orphaned ID: #\{val} >>\" if val
584
- bt_id = bt_id_col.map { |id_col| #{obj_name}.send(id_col.to_sym) } if bt_id_col&.present? %>
588
+ bt_txt ||= \"<span class=\\\"orphan\\\">&lt;&lt; Orphaned ID: #\{val} >></span>\".html_safe if val
589
+ bt_id = bt_id_col.map { |id_col| #{obj_name}.send(id_col.to_sym) } %>
585
590
  <%= bt_id&.first ? link_to(bt_txt, send(\"#\{bt_class.base_class.name.underscore.tr('/', '_')\}_path\".to_sym, bt_id)) : bt_txt %>
586
591
  <%#= Previously was: bt_obj = bt[1].first.first.find_by(bt[2] => val); link_to(bt_obj.brick_descrip, send(\"#\{bt[1].first.first.name.underscore\}_path\".to_sym, bt_obj.send(bt[1].first.first.primary_key.to_sym))) if bt_obj %>
587
592
  <% end %>
@@ -689,18 +694,21 @@ end
689
694
  <%= if (bt_obj = bt_class&.find_by(bt_pair[1] => val))
690
695
  link_to('⇛', send(\"#\{bt_class.base_class.name.underscore.tr('/', '_')\}_path\".to_sym, bt_obj.send(bt_class.primary_key.to_sym)), { class: 'show-arrow' })
691
696
  elsif val
692
- \"<span>Orphaned ID: #\{val}</span>\".html_safe
697
+ \"<span class=\\\"orphan\\\">Orphaned ID: #\{val}</span>\".html_safe
693
698
  end %><svg class=\"revert\" width=\"1.5em\" viewBox=\"0 0 512 512\"><use xlink:href=\"#revertPath\" /></svg>
694
- <% else case (col_type = #{model_name}.column_for_attribute(k).type)
699
+ <% else
700
+ html_options = {}
701
+ html_options[:class] = 'dimmed' unless val
702
+ case (col_type = #{model_name}.column_for_attribute(k).type)
695
703
  when :string, :text %>
696
704
  <% if is_bcrypt?(val) # || .readonly? %>
697
705
  <%= hide_bcrypt(val, 1000) %>
698
706
  <% else %>
699
- <div class=\"wide-input\"><%= f.text_field k.to_sym %><svg class=\"revert\" width=\"1.5em\" viewBox=\"0 0 512 512\"><use xlink:href=\"#revertPath\" /></svg></div>
707
+ <div class=\"wide-input\"><%= f.text_field(k.to_sym, html_options) %><svg class=\"revert\" width=\"1.5em\" viewBox=\"0 0 512 512\"><use xlink:href=\"#revertPath\" /></svg></div>
700
708
  <% end %>
701
709
  <% when :boolean %>
702
710
  <%= f.check_box k.to_sym %><svg class=\"revert\" width=\"1.5em\" viewBox=\"0 0 512 512\"><use xlink:href=\"#revertPath\" /></svg>
703
- <% when :integer, :decimal, :float
711
+ <% when :integer, :decimal, :float %>
704
712
  <%= if col_type == :integer
705
713
  f.text_field k.to_sym, { pattern: '\\d*', class: 'check-validity' }
706
714
  else
@@ -710,10 +718,11 @@ end
710
718
  is_includes_dates = true %>
711
719
  <%= f.text_field k.to_sym, { class: dt_pickers[col_type] } %><svg class=\"revert\" width=\"1.5em\" viewBox=\"0 0 512 512\"><use xlink:href=\"#revertPath\" /></svg>
712
720
  <% when :uuid %>
713
- # Postgres naturally uses the +uuid_generate_v4()+ function from the uuid-ossp extension
714
- # If it's not yet enabled then: enable_extension 'uuid-ossp'
715
- # ActiveUUID gem created a new :uuid type %>
716
- <%= val %>
721
+ <%=
722
+ # Postgres naturally uses the +uuid_generate_v4()+ function from the uuid-ossp extension
723
+ # If it's not yet enabled then: enable_extension 'uuid-ossp'
724
+ # ActiveUUID gem created a new :uuid type
725
+ val %>
717
726
  <% when :binary, :primary_key %>
718
727
  <% end %>
719
728
  <% end %>
@@ -721,7 +730,7 @@ end
721
730
  </tr>
722
731
  <% end
723
732
  if has_fields %>
724
- <tr><td colspan=\"2\" class=\"right\"><%= f.submit %></td></tr>
733
+ <tr><td colspan=\"2\"><%= f.submit({ class: 'update' }) %></td></tr>
725
734
  <% else %>
726
735
  <tr><td colspan=\"2\">(No displayable fields)</td></tr>
727
736
  <% end %>
@@ -5,7 +5,7 @@ module Brick
5
5
  module VERSION
6
6
  MAJOR = 1
7
7
  MINOR = 0
8
- TINY = 44
8
+ TINY = 45
9
9
 
10
10
  # PRE is nil unless it's a pre-release (beta, RC, etc.)
11
11
  PRE = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brick
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.44
4
+ version: 1.0.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorin Thwaits