brick 1.0.137 → 1.0.138

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f25abe6f88b55efadd50c9deb65e7d9aabac31482a77f0f911f84157d4394079
4
- data.tar.gz: a437b8efd9116a7c1e5a81fa6d67a66755b15a275db56717ecb7abe76bbbb50a
3
+ metadata.gz: 2f044e21a6e4c2120a453b6cb3dc404d4d3e3e15034c638d316cbc418bcb996b
4
+ data.tar.gz: f3360e5e7778bacde155e58bf0683d6b75c74d7dd63d336131e82b0a1865199a
5
5
  SHA512:
6
- metadata.gz: 21ea85675d6e711261c8873c12187d78ecfdb53961a8ba795d35210b2a7cd00940d3522def3f3c8f10d37e3f7a8409f68efefc923798847b602f8d8afe24316f
7
- data.tar.gz: b34c4d0396aea262f73e34bc25d4f0e2d9e2d3bddb36aa1293d7e7293edfed9f930318724c8471f11344822b6faa4afa942018148ed59cfa27d50eef6bca0eea
6
+ metadata.gz: 413c6fe2526752eab0e24998b852e9ae68ef7f56a6488bc14b777e13a4ad281f6c352af465be9e49f05e20fa597e7750d3c706df762f74eb70a18fda5112a319
7
+ data.tar.gz: cb5040c5333dfa0c0fcbd9d1c04c229e538db1b33fc1526ace987d6da8bd1634e50269e5e05249da6205980ac79c3bad792dd5cc2242115349846365a881bf81
@@ -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
@@ -88,7 +88,7 @@ module Brick::Rails::FormBuilder
88
88
  end
89
89
  when :primary_key
90
90
  is_revert = false
91
- when :json
91
+ when :json, :jsonb
92
92
  template.instance_variable_set(:@_json_fields_present, true)
93
93
  if val.is_a?(String)
94
94
  val_str = val
@@ -5,7 +5,7 @@ module Brick
5
5
  module VERSION
6
6
  MAJOR = 1
7
7
  MINOR = 0
8
- TINY = 137
8
+ TINY = 138
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.137
4
+ version: 1.0.138
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorin Thwaits