brick 1.0.144 → 1.0.145

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: 6b84f681ffcc3cfbc37531e21ee68c07a27df07d0b0b63aed94d7e13fedc8ec1
4
- data.tar.gz: b1f96b376d7c27b9a01e8025f8628efdfedff77875b089323e66bdff557a4141
3
+ metadata.gz: 4eb70e62d39a7516769b8476c99af1173eb9965d551146a1287fcd615faedf22
4
+ data.tar.gz: 3a8f9635d6d7db583df4354a1d0cbde013d7df9ec07101e0b6ffa92bece48134
5
5
  SHA512:
6
- metadata.gz: d6b2dfbd93defb98b61bd20c405657d8b3df5c9f1c4887dc37fe75a09fdcc61abc9ba15a1e9a16006487017f270d62ca1843fefeea574eb8df07fc55f136693b
7
- data.tar.gz: 4f1d192f9420b9f8cfac9fa7d6f7f6c057d5bb0f852b8066937f79410b20005b4080b6bdec16f2e470e8fa1a9e5331fd26b64d675e1e397942ec65a371f8d977
6
+ metadata.gz: 9faadbd4e71fe53a5deb94424133b701d6db9a64b12323e804385cb1a4df3e68b7a8da1c5d59f14efe2ef5b2e1e20e7543cb427a924f9ae0e41008f5e0a4b75d
7
+ data.tar.gz: d296a285cdb3a08482e36d0d1be52bb18709d63aa38677e1887157f88e3a7123b3b6f6e54f50241b915f68d272f30dec5db28b5efd74ae41e099ffca5abc7c89
@@ -2661,6 +2661,7 @@ ORDER BY 1, 2, c.internal_column_id, acc.position"
2661
2661
 
2662
2662
  def retrieve_schema_and_tables(sql = nil, is_postgres = nil, is_mssql = nil, schema = nil)
2663
2663
  is_mssql = ActiveRecord::Base.connection.adapter_name == 'SQLServer' if is_mssql.nil?
2664
+ params = ar_tables
2664
2665
  sql ||= "SELECT t.table_schema AS \"schema\", t.table_name AS relation_name, t.table_type,#{"
2665
2666
  pg_catalog.obj_description(
2666
2667
  ('\"' || t.table_schema || '\".\"' || t.table_name || '\"')::regclass::oid, 'pg_class'
@@ -2698,12 +2699,16 @@ ORDER BY 1, 2, c.internal_column_id, acc.position"
2698
2699
  "NOT IN ('information_schema', 'pg_catalog', 'pg_toast', 'heroku_ext',
2699
2700
  'INFORMATION_SCHEMA', 'sys')"
2700
2701
  :
2701
- "= '#{ActiveRecord::Base.connection.current_database&.tr("'", "''")}'"}#{"
2702
- AND t.table_schema = COALESCE(current_setting('SEARCH_PATH'), 'public')" if is_postgres && schema }
2702
+ "= '#{ActiveRecord::Base.connection.current_database&.tr("'", "''")}'"}#{
2703
+ if is_postgres && schema
2704
+ params = params.unshift(schema) # Used to use this SQL: current_setting('SEARCH_PATH')
2705
+ "
2706
+ AND t.table_schema = COALESCE(?, 'public')"
2707
+ end}
2703
2708
  -- AND t.table_type IN ('VIEW') -- 'BASE TABLE', 'FOREIGN TABLE'
2704
2709
  AND t.table_name NOT IN ('pg_stat_statements', ?, ?)
2705
2710
  ORDER BY 1, t.table_type DESC, 2, c.ordinal_position"
2706
- ActiveRecord::Base.execute_sql(sql, *ar_tables)
2711
+ ActiveRecord::Base.execute_sql(sql, *params)
2707
2712
  end
2708
2713
 
2709
2714
  def ar_tables
@@ -5,7 +5,7 @@ module Brick
5
5
  module VERSION
6
6
  MAJOR = 1
7
7
  MINOR = 0
8
- TINY = 144
8
+ TINY = 145
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.144
4
+ version: 1.0.145
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-05-23 00:00:00.000000000 Z
11
+ date: 2023-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord