brick 1.0.201 → 1.0.202

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: 52b363a56451567ff44ebee4510f850eb6f1df3d09bf05392c75a3c0444daa73
4
- data.tar.gz: bd39b40ba7fbeae5f9225ba8a9591f53082f60ee6f89f68b9bc83199656c75fd
3
+ metadata.gz: 80bf405e5c622d90a9e52cb94a9310740397a80c39add78a925a32f72c6ba75c
4
+ data.tar.gz: a434b961891001ba5c41767321392b390b0ab2c28bf1a5a323aae373686fe96f
5
5
  SHA512:
6
- metadata.gz: e095c942770c458142026d918aa7084853d23963c0802dbda7a7773b504cc2a6a751369cbf58214453aa83e004230b8bab9ff7c2d1040bffc9f28a5b371c894e
7
- data.tar.gz: 4d15b729fea0b416cf75fc18a6ce11c28eea989438d831de94710d8878ee9cb2174df7a5075028922691acceea9af2322591f4219b8dbca16b7a25716c55ee09
6
+ metadata.gz: 2354f0b013d84f3cd0cd5a41656eefa39acaff5f7c0cc64d0be4382ef7f97ca60187895a2bcdb48d425145c5712511c5c4bde321b1f643a64c47f865597c565d
7
+ data.tar.gz: 9badc9353850afc991f7a17e964a262827ec23c7d6df62d4e4591d905460e21001f0c7e898f5b09ba1e41afbe077d39c24de03d82ffb8f6d7b43d66572f05f1f
@@ -1508,7 +1508,7 @@ module Brick
1508
1508
  ::Brick::ADD_AVO_FIELDS.call(self, model)
1509
1509
  end
1510
1510
  end
1511
- ::Avo::BaseResource.const_set(requested.to_sym, built_resource)
1511
+ ::Avo::Resources.const_set(requested.to_sym, built_resource)
1512
1512
  built_resource
1513
1513
  end
1514
1514
  end
@@ -225,14 +225,6 @@ function linkSchemas() {
225
225
  # Specific database tables and views to omit when auto-creating models
226
226
  ::Brick.exclude_tables = app.config.brick.fetch(:exclude_tables, [])
227
227
 
228
- # Class for auto-generated models to inherit from
229
- ::Brick.models_inherit_from = app.config.brick.fetch(:models_inherit_from, nil) ||
230
- begin
231
- ::ApplicationRecord
232
- rescue StandardError => ex
233
- ::ActiveRecord::Base
234
- end
235
-
236
228
  # When table names have specific prefixes, automatically place them in their own module with a table_name_prefix.
237
229
  ::Brick.config.table_name_prefixes ||= app.config.brick.fetch(:table_name_prefixes, {})
238
230
 
@@ -340,8 +332,8 @@ function linkSchemas() {
340
332
  end
341
333
  end
342
334
  end
343
- else # Avo 2.x
344
- (self::App.respond_to?(:eager_load) ? App : DynamicRouter).class_exec do
335
+ elsif self::App.respond_to?(:eager_load) # Avo 2.x (compatible with 2.20.0 and up)
336
+ App.class_exec do
345
337
  class << self
346
338
  alias _brick_eager_load eager_load
347
339
  def eager_load(entity)
@@ -368,7 +360,10 @@ function linkSchemas() {
368
360
  if is_2x # Avo 2.x?
369
361
  "::#{class_name}Resource".constantize
370
362
  else # Avo 3.x
371
- ::Brick.avo_3x_resource(Object.const_get(class_name), class_name) unless ::Avo::BaseResource.constants.include?(class_name.to_sym)
363
+ unless ::Avo::BaseResource.constants.include?(class_name.to_sym) ||
364
+ ::Avo::Resources.constants.include?(class_name.to_sym)
365
+ ::Brick.avo_3x_resource(Object.const_get(class_name), class_name)
366
+ end
372
367
  end
373
368
  end
374
369
  end
@@ -426,12 +421,14 @@ window.addEventListener(\"popstate\", linkSchemas);
426
421
  end
427
422
 
428
423
  class Fields::IndexComponent
429
- alias _brick_resource_view_path resource_view_path
430
- def resource_view_path
431
- mdl_class = @resource.respond_to?(:model_class) ? @resource.model_class : @resource.model&.class
432
- return if mdl_class&.is_view?
424
+ if respond_to?(:resource_view_path)
425
+ alias _brick_resource_view_path resource_view_path
426
+ def resource_view_path
427
+ mdl_class = @resource.respond_to?(:model_class) ? @resource.model_class : @resource.model&.class
428
+ return if mdl_class&.is_view?
433
429
 
434
- _brick_resource_view_path
430
+ _brick_resource_view_path
431
+ end
435
432
  end
436
433
  end
437
434
 
@@ -1656,10 +1653,8 @@ end
1656
1653
  # path_options = [obj.#{pk}]
1657
1654
  # path_options << { '_brick_schema': } if
1658
1655
  options = {}
1659
- if ::Brick.config.path_prefix || (obj.class.table_name.singularize == obj.class.table_name)
1660
- path_helper = obj.new_record? ? #{model_name}._brick_index : #{model_name}._brick_index(:singular)
1661
- options[:url] = send(\"#\{path_helper}_path\".to_sym, obj)
1662
- end
1656
+ path_helper = obj.new_record? ? #{model_name}._brick_index : #{model_name}._brick_index(:singular)
1657
+ options[:url] = send(\"#\{path_helper}_path\".to_sym, obj) if ::Brick.config.path_prefix || (path_helper != obj.class.table_name)
1663
1658
  %>
1664
1659
  <br><br>
1665
1660
 
@@ -5,7 +5,7 @@ module Brick
5
5
  module VERSION
6
6
  MAJOR = 1
7
7
  MINOR = 0
8
- TINY = 201
8
+ TINY = 202
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.201
4
+ version: 1.0.202
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorin Thwaits
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-03 00:00:00.000000000 Z
11
+ date: 2024-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -285,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
285
  - !ruby/object:Gem::Version
286
286
  version: 1.3.6
287
287
  requirements: []
288
- rubygems_version: 3.2.33
288
+ rubygems_version: 3.1.6
289
289
  signing_key:
290
290
  specification_version: 4
291
291
  summary: Create a Rails app from data alone