brick 1.0.95 → 1.0.97

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: ebb01aca7fcf3fa8cfbb699e48fa85601341df79645d4f3d6ebc5a43351c3d29
4
- data.tar.gz: 2bca81242ee8eaa5bbfd477b39df8eb969f8999abe680329e2ae9b1b4ef928a7
3
+ metadata.gz: c257a0a65807fa87a13d722f3cc30c38d51bde571a070df53f4277fc6db8b7ba
4
+ data.tar.gz: 74d7690a968fab671d9e9e8ac92e41885ceb44a700fd1cb293f3b79af819e463
5
5
  SHA512:
6
- metadata.gz: 566f2e6925b918fb8c7b3bf545dc8fd98f840b35fdf875e0f7812de3f127dae21e2fd4b9a2f3e9faba5255ec83d76b0651657e0051aa8e9706429354dee4d012
7
- data.tar.gz: b07ce93b35464f516e3f03b1c8c98d215b3fa2db1051af5d6d41131313d694e483cc7cc40a063b6fd6b70e6d5eb2afb99fb9cc47914a81e6dc0a2392a5b2602c
6
+ metadata.gz: 4337faa80a6f0d9c1dadcb3271aea14ec54bb91e72cd7eead7e59c860557f828ac073cab3768feaa2db2f664d63b1604bd8f8e0d53c64621b1fcf5cc041057d9
7
+ data.tar.gz: 541cade2070bd0a79b21dd7155df700b2739084ae81eaa02709f9e00164f956e62e8342330a78496c4b5fbf351cac9ea40483d3cdc32c1fb1dbe8d7e34499d2d
data/lib/brick/config.rb CHANGED
@@ -304,12 +304,12 @@ module Brick
304
304
  true
305
305
  end
306
306
 
307
- def license_key
308
- @mutex.synchronize { @license_key }
307
+ def license
308
+ @mutex.synchronize { @license }
309
309
  end
310
310
 
311
- def license_key=(key)
312
- @mutex.synchronize { @license_key = key }
311
+ def license=(key)
312
+ @mutex.synchronize { @license = key }
313
313
  end
314
314
  end
315
315
  end
@@ -1097,10 +1097,10 @@ erDiagram
1097
1097
  end
1098
1098
 
1099
1099
  when 'crosstab'
1100
- if is_crosstab && ::Brick.config.license_key
1100
+ if is_crosstab && ::Brick.config.license
1101
1101
  decipher = OpenSSL::Cipher::AES256.new(:CBC).decrypt
1102
1102
  decipher.iv = "\xB4,\r2\x19\xF5\xFE/\aR\x1A\x8A\xCFV\v\x8C"
1103
- decipher.key = Digest::SHA256.hexdigest(::Brick.config.license_key).scan(/../).map { |x| x.hex }.pack('c*')
1103
+ decipher.key = Digest::SHA256.hexdigest(::Brick.config.license).scan(/../).map { |x| x.hex }.pack('c*')
1104
1104
  decipher.update(File.binread("/Users/aga/brick/lib/brick/frameworks/rails/crosstab.brk"))[16..-1]
1105
1105
  else
1106
1106
  'Crosstab Charting not yet activated -- enter a valid license key in brick.rb'
@@ -5,7 +5,7 @@ module Brick
5
5
  module VERSION
6
6
  MAJOR = 1
7
7
  MINOR = 0
8
- TINY = 95
8
+ TINY = 97
9
9
 
10
10
  # PRE is nil unless it's a pre-release (beta, RC, etc.)
11
11
  PRE = nil
data/lib/brick.rb CHANGED
@@ -466,8 +466,8 @@ module Brick
466
466
  Brick.config.default_route_fallback = resource_name
467
467
  end
468
468
 
469
- def license_key=(key)
470
- Brick.config.license_key = key
469
+ def license=(key)
470
+ Brick.config.license = key
471
471
  end
472
472
 
473
473
  # Load additional references (virtual foreign keys)
@@ -1284,38 +1284,38 @@ module ActiveRecord
1284
1284
  else
1285
1285
  relation.select_values.clear
1286
1286
  end
1287
- end
1288
1287
 
1289
- @aliases ||= Aliases.new(join_root.each_with_index.map do |join_part, i|
1290
- join_alias = join_part.table&.table_alias || join_part.table_name
1291
- keys = [join_part.base_klass.primary_key] # Always include the primary key
1288
+ @aliases ||= Aliases.new(join_root.each_with_index.map do |join_part, i|
1289
+ join_alias = join_part.table&.table_alias || join_part.table_name
1290
+ keys = [join_part.base_klass.primary_key] # Always include the primary key
1292
1291
 
1293
- # # %%% Optional to include all foreign keys:
1294
- # keys.concat(join_part.base_klass.reflect_on_all_associations.select { |a| a.belongs_to? }.map(&:foreign_key))
1292
+ # # %%% Optional to include all foreign keys:
1293
+ # keys.concat(join_part.base_klass.reflect_on_all_associations.select { |a| a.belongs_to? }.map(&:foreign_key))
1295
1294
 
1296
- # Add foreign keys out to referenced tables that we belongs_to
1297
- join_part.children.each { |child| keys << child.reflection.foreign_key if child.reflection.belongs_to? }
1295
+ # Add foreign keys out to referenced tables that we belongs_to
1296
+ join_part.children.each { |child| keys << child.reflection.foreign_key if child.reflection.belongs_to? }
1298
1297
 
1299
- # Add the foreign key that got us here -- "the train we rode in on" -- if we arrived from
1300
- # a has_many or has_one:
1301
- if join_part.is_a?(ActiveRecord::Associations::JoinDependency::JoinAssociation) &&
1302
- !join_part.reflection.belongs_to?
1303
- keys << join_part.reflection.foreign_key
1304
- end
1305
- keys = keys.compact # In case we're using composite_primary_keys
1306
- j = 0
1307
- columns = join_part.column_names.each_with_object([]) do |column_name, s|
1308
- # Include columns chosen in select(...) as well as the PK and any relevant FKs
1309
- if used_cols.keys.find { |c| (c.length == 1 || c.first == join_alias) && c.last == column_name } ||
1310
- keys.find { |c| c == column_name }
1311
- s << Aliases::Column.new(column_name, "t#{i}_r#{j}")
1298
+ # Add the foreign key that got us here -- "the train we rode in on" -- if we arrived from
1299
+ # a has_many or has_one:
1300
+ if join_part.is_a?(ActiveRecord::Associations::JoinDependency::JoinAssociation) &&
1301
+ !join_part.reflection.belongs_to?
1302
+ keys << join_part.reflection.foreign_key
1312
1303
  end
1313
- j += 1
1314
- end
1315
- Aliases::Table.new(join_part, columns)
1316
- end)
1304
+ keys = keys.compact # In case we're using composite_primary_keys
1305
+ j = 0
1306
+ columns = join_part.column_names.each_with_object([]) do |column_name, s|
1307
+ # Include columns chosen in select(...) as well as the PK and any relevant FKs
1308
+ if used_cols.keys.find { |c| (c.length == 1 || c.first == join_alias) && c.last == column_name } ||
1309
+ keys.find { |c| c == column_name }
1310
+ s << Aliases::Column.new(column_name, "t#{i}_r#{j}")
1311
+ end
1312
+ j += 1
1313
+ end
1314
+ Aliases::Table.new(join_part, columns)
1315
+ end)
1316
+ end
1317
1317
 
1318
- relation._select!(-> { @aliases.columns })
1318
+ relation._select!(-> { aliases.columns })
1319
1319
  end
1320
1320
 
1321
1321
  private
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.95
4
+ version: 1.0.97
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorin Thwaits
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-24 00:00:00.000000000 Z
11
+ date: 2022-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord