brick 1.0.176 → 1.0.178
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/extensions.rb +7 -2
- data/lib/brick/frameworks/rails/engine.rb +2 -1
- data/lib/brick/version_number.rb +1 -1
- data/lib/brick.rb +23 -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: 888b7144102e5155a28f931b7b986a68a3eb781dee890990fae9f81ed8bf2e21
|
4
|
+
data.tar.gz: c5fcc9dd02f6b45025d600e9a02a16011e93559568c63c24b4acde0f603a2540
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8f32f40106be993ee33bac87ef4dad4558e7bcbae61f6f61658671b825eba6312586f75fdc329c22a3a2898a2d38e568c70e05ca173e9824637226ce28aaee3
|
7
|
+
data.tar.gz: e3e0fa0646201059751ecf8fdd30860d582aa3e746ceeb3c6cac276aa831dcefe6a9fc8de34f6e4a720fcd5503842192e8cd8f33ceed37cb6087000d342223ee
|
data/lib/brick/extensions.rb
CHANGED
@@ -1553,9 +1553,13 @@ class Object
|
|
1553
1553
|
end))
|
1554
1554
|
end
|
1555
1555
|
hmts = nil
|
1556
|
+
if (schema_module || Object).const_defined?((chosen_name = (inheritable_name || model_name)).to_sym)
|
1557
|
+
possible = (schema_module || Object).const_get(chosen_name)
|
1558
|
+
return possible unless possible == schema_module
|
1559
|
+
end
|
1556
1560
|
code = +"class #{full_name} < #{base_model.name}\n"
|
1557
1561
|
built_model = Class.new(base_model) do |new_model_class|
|
1558
|
-
(schema_module || Object).const_set(
|
1562
|
+
(schema_module || Object).const_set(chosen_name, new_model_class)
|
1559
1563
|
@_brick_relation = relation
|
1560
1564
|
if inheritable_name
|
1561
1565
|
new_model_class.define_singleton_method :inherited do |subclass|
|
@@ -3100,7 +3104,8 @@ module Brick
|
|
3100
3104
|
missing << fk[1] unless relations.key?(fk[1])
|
3101
3105
|
missing << primary_table unless is_class || relations.key?(primary_table)
|
3102
3106
|
unless missing.empty?
|
3103
|
-
tables = relations.reject { |_k, v| v.fetch(:isView, nil) }.keys
|
3107
|
+
tables = relations.reject { |_k, v| v.is_a?(Hash) && v.fetch(:isView, nil) }.keys
|
3108
|
+
.select { |table_name| table_name.is_a?(String) }.sort
|
3104
3109
|
puts "Brick: Additional reference #{fk.inspect} refers to non-existent #{'table'.pluralize(missing.length)} #{missing.join(' and ')}. (Available tables include #{tables.join(', ')}.)"
|
3105
3110
|
return
|
3106
3111
|
end
|
@@ -1489,7 +1489,8 @@ end
|
|
1489
1489
|
decipher = OpenSSL::Cipher::AES256.new(:CBC).decrypt
|
1490
1490
|
decipher.iv = "\xB4,\r2\x19\xF5\xFE/\aR\x1A\x8A\xCFV\v\x8C"
|
1491
1491
|
decipher.key = Digest::SHA256.hexdigest(::Brick.config.license).scan(/../).map { |x| x.hex }.pack('c*')
|
1492
|
-
|
1492
|
+
brick_path = Gem::Specification.find_by_name('brick').gem_dir
|
1493
|
+
decipher.update(File.binread("#{brick_path}/lib/brick/frameworks/rails/crosstab.brk"))[16..-1]
|
1493
1494
|
else
|
1494
1495
|
'Crosstab Charting not yet activated -- enter a valid license key in brick.rb'
|
1495
1496
|
end
|
data/lib/brick/version_number.rb
CHANGED
data/lib/brick.rb
CHANGED
@@ -89,7 +89,7 @@ end
|
|
89
89
|
# is first established), and then automatically creates models, controllers, views,
|
90
90
|
# and routes based on those available relations.
|
91
91
|
require 'brick/config'
|
92
|
-
if Gem::Specification.all_names.any? { |g| g.start_with?('rails-') && g[6..-1] =~ /^([0-9]|\.)
|
92
|
+
if Gem::Specification.all_names.any? { |g| g.start_with?('rails-') && g[6..-1] =~ /^([0-9]|\.)+(?:|rc1|rc2|beta1)$/ }
|
93
93
|
require 'rails'
|
94
94
|
require 'brick/frameworks/rails'
|
95
95
|
end
|
@@ -2026,6 +2026,28 @@ if ActiveRecord.version < ::Gem::Version.new('6.0') && ruby_version >= ::Gem::Ve
|
|
2026
2026
|
end
|
2027
2027
|
end
|
2028
2028
|
|
2029
|
+
# AR >= 5.0 on Ruby >= 3.0
|
2030
|
+
::ActiveRecord::Type::AdapterSpecificRegistry.class_exec do
|
2031
|
+
alias :_brick_add_modifier :add_modifier
|
2032
|
+
def add_modifier(*args, **kwargs)
|
2033
|
+
kwargs.merge!(args.pop) if args.length > 2 && args.last.is_a?(Hash)
|
2034
|
+
_brick_add_modifier(*args, **kwargs)
|
2035
|
+
end
|
2036
|
+
end
|
2037
|
+
|
2038
|
+
# AR >= 5.0 on Ruby >= 3.0
|
2039
|
+
arca = ::ActiveRecord::ConnectionAdapters
|
2040
|
+
require 'active_record/connection_adapters/postgresql/column'
|
2041
|
+
if arca.const_defined?('PostgreSQLColumn')
|
2042
|
+
arca::PostgreSQLColumn.class_exec do
|
2043
|
+
alias :_brick_initialize :initialize
|
2044
|
+
def initialize(*args, **kwargs)
|
2045
|
+
kwargs.merge!(args.pop) if args.last.is_a?(Hash)
|
2046
|
+
_brick_initialize(*args, **kwargs)
|
2047
|
+
end
|
2048
|
+
end
|
2049
|
+
end
|
2050
|
+
|
2029
2051
|
require 'active_model'
|
2030
2052
|
begin
|
2031
2053
|
require 'active_model/type'
|
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.178
|
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-
|
11
|
+
date: 2023-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|