panda_pal 5.13.1 → 5.13.2.beta1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1abce4e925e36c353a2985ec394d6cd3663a81023cecc9f40b7844cb6a6cfe58
4
- data.tar.gz: 902fa5a2ad91c17df04f1c248a12d8db0bb32cab382b080ac6c1cce2071582e9
3
+ metadata.gz: d3353ec5d316b6281d3f36aae115be6b05b45e49b2ff5619e16bfdf81f68e2cd
4
+ data.tar.gz: 60f5538f2b3059154609a957f0da4d05155cb7661252c2fe22feabda54160a19
5
5
  SHA512:
6
- metadata.gz: d0e4eeca5d559276222b43c3738af1be4c5c2516092eecaef8b2f389dfc0549671a2081d3e38596c8d2e31c12cc89aaa1af3bd2789ab7815a7aa95ac4e598e8a
7
- data.tar.gz: c8dd6a0afa0655cd0568fe21f3d41329ea5071c3794968c0399a39067607d484636a5ed0f97c4650852862ec97549a64b3f10082406249b3f1928fc173f4601f
6
+ metadata.gz: b90632ccc8ddc83f8b151967306e6d079f71735c5838e3a0c74096fbecf9fff42a89aa0eb6dc6fd5ef7bac0297dbbe0c72b37caf29d021179c18c631571f6b11
7
+ data.tar.gz: 2325cc99407ad3ead97e00eeb6988c525176222efb4343388506ed1ace6dac1a49d2ddb219ac47946eefc5076b90609c6bdc5ad0d4f694e16ef4939cc112fc50
@@ -149,6 +149,14 @@ module PandaPal
149
149
  code << "\n"
150
150
  end
151
151
 
152
+ if PandaPal::Organization.column_names.include?("shard")
153
+ code << "# " if persisted?
154
+ cur_shard = self.shard || "default"
155
+ valid_shards = Apartment.shard_configurations.keys
156
+ code << "shard: \"#{self.shard}\", # #{valid_shards.join(" | ")}"
157
+ code << "\n"
158
+ end
159
+
152
160
  code << "settings: "
153
161
  code << PandaPal::Organization.generate_settings_ruby(value: settings)
154
162
  code << ",\n"
@@ -14,12 +14,16 @@ module Apartment
14
14
  $shard_configurations ||= begin
15
15
  shard_to_env = {}
16
16
 
17
+ base_config = Apartment.connection_config
18
+
17
19
  ENV.keys.each do |k|
18
20
  m = /^(#{SHARD_PREFIXES.join("|")})_(\w+)_URL$/.match(k)
19
21
  next unless m
20
22
 
21
23
  url = ENV[k]
22
- shard_to_env[m[2].downcase] = ActiveRecord::Base.configurations.resolve(url).configuration_hash
24
+ shardcfg = ActiveRecord::Base.configurations.resolve(url).configuration_hash
25
+ shardcfg = base_config.merge(shardcfg || {})
26
+ shard_to_env[m[2].downcase] = shardcfg
23
27
  end
24
28
 
25
29
  shard_to_env.freeze unless Rails.env.test?
@@ -220,6 +224,7 @@ Rails.application.config.middleware.use Apartment::Elevators::Generic, lambda {
220
224
  PandaPal::Organization.find_by(name: match[1]).try(:tenant_name)
221
225
  elsif request.path.start_with?('/rails/active_storage/blobs/')
222
226
  PandaPal::Organization.find_by(id: request.params['organization_id']).try(:tenant_name)
227
+ # TODO Always check params[organization_id]?
223
228
  end
224
229
  }
225
230
 
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.13.1"
2
+ VERSION = "5.13.2.beta1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.13.1
4
+ version: 5.13.2.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure CustomDev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-21 00:00:00.000000000 Z
11
+ date: 2025-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails