brick 1.0.184 → 1.0.185
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 +4 -4
- data/lib/brick/compatibility.rb +6 -2
- data/lib/brick/frameworks/rails/engine.rb +2 -2
- data/lib/brick/version_number.rb +1 -1
- data/lib/brick.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d930911e6903179271b74220c325ba024dfebe26f87eec06111772bfe1dd6b39
|
4
|
+
data.tar.gz: fb0767bf7e59c56dffbe1999ee86ca3cefe66040dd26387019f2d45b8776fcd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d03584188eaf7ba5a41b37fd80470f6eeb8c166949f4e19f1e2a9ccf958b94d0864c25f16363fbaae1980c36d8e82ec0eacf731cd5bdee97ec819a68be4b9836
|
7
|
+
data.tar.gz: 5fc2966228117b7d35e5370ff64f2f46e85e8bfa8a1a4a4df8732e91fe0e0f4c0a5050cc7b77d44217538a7bc46681a24ebd03d0fc6ff69f483f7a7861f74a38
|
data/lib/brick/compatibility.rb
CHANGED
@@ -48,10 +48,14 @@ if ::Gem::Version.new(RUBY_VERSION) >= ::Gem::Version.new('2.7')
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
unless ActiveRecord.const_defined?(:NoDatabaseError)
|
51
|
+
unless ActiveRecord.const_defined?(:NoDatabaseError)
|
52
52
|
require 'active_model'
|
53
|
+
require 'active_record/deprecator' if ActiveRecord.version >= Gem::Version.new('7.1.0')
|
53
54
|
require 'active_record/errors'
|
54
|
-
|
55
|
+
# Generic version of NoDatabaseError for Rails <= 4.0
|
56
|
+
unless ActiveRecord.const_defined?(:NoDatabaseError)
|
57
|
+
class ::ActiveRecord::NoDatabaseError < ::ActiveRecord::StatementInvalid
|
58
|
+
end
|
55
59
|
end
|
56
60
|
end
|
57
61
|
|
@@ -1966,7 +1966,7 @@ document.querySelectorAll(\"input, select\").forEach(function (inp) {
|
|
1966
1966
|
def viable_models
|
1967
1967
|
return _brick_viable_models if ::RailsAdmin::Config.class_variables.include?(:@@system_models)
|
1968
1968
|
|
1969
|
-
brick_models = ::Brick.relations.
|
1969
|
+
brick_models = ::Brick.relations.each_with_object([]) { |rel, s| s << rel.last[:class_name] unless rel.first.is_a?(Symbol) }
|
1970
1970
|
|
1971
1971
|
# The original from RailsAdmin (now aliased as _brick_viable_models) loads all classes
|
1972
1972
|
# in the whole project. This Brick approach is a little more tame.
|
@@ -1999,7 +1999,7 @@ document.querySelectorAll(\"input, select\").forEach(function (inp) {
|
|
1999
1999
|
end
|
2000
2000
|
|
2001
2001
|
RailsAdmin.config do |config|
|
2002
|
-
::Brick.relations.select { |_k, v| v.key?(:isView) }.each do |_k, relation|
|
2002
|
+
::Brick.relations.select { |_k, v| v.is_a?(Hash) && v.key?(:isView) }.each do |_k, relation|
|
2003
2003
|
config.model(relation[:class_name]) do # new_model_class
|
2004
2004
|
list do
|
2005
2005
|
sort_by (sort_col = relation[:cols].first.first)
|
data/lib/brick/version_number.rb
CHANGED
data/lib/brick.rb
CHANGED
@@ -162,6 +162,8 @@ module Brick
|
|
162
162
|
h[:db_name] = db_name if db_name
|
163
163
|
end
|
164
164
|
end
|
165
|
+
rescue ActiveRecord::NoDatabaseError
|
166
|
+
{}
|
165
167
|
end
|
166
168
|
|
167
169
|
def apartment_multitenant
|
@@ -1916,7 +1918,7 @@ module ActiveRecord
|
|
1916
1918
|
private
|
1917
1919
|
|
1918
1920
|
# %%% Pretty much have to flat-out replace this guy (I think anyway)
|
1919
|
-
# Good with Rails 5.
|
1921
|
+
# Good with Rails 5.2.4 through 7.1 on this
|
1920
1922
|
# Ransack gem includes Polyamorous which replaces #build in a different way (which we handle below)
|
1921
1923
|
unless Gem::Specification.all_names.any? { |g| g.start_with?('ransack-') }
|
1922
1924
|
def build(associations, base_klass, root = nil, path = '')
|
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.
|
4
|
+
version: 1.0.185
|
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-10-
|
11
|
+
date: 2023-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|