panda_pal 5.12.0 → 5.12.1

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: ab899936461dc59208ae6afef28264feda7a75927798e158ca1ee8381b2ea463
4
- data.tar.gz: 20424ac6bef9bede8af9e58e8a1393267b0966f96cf56dd8ae8ed0e5b486420a
3
+ metadata.gz: c7b257eddedb1431e4a8030cae79245ef3c0da635ac47cd7e3d1b7ac223d630c
4
+ data.tar.gz: cff44cd6c69723032155a0e82a952f1ceaec1bbcc991014ab5ea5fd75a3404db
5
5
  SHA512:
6
- metadata.gz: 85041955aabe8255fcf0a4e3cbcfce3c55c690e0d66d74ac511d6b4d70825d796a62a18fe3ac3e0b5dc66e9ddc865c5b45f672940d92c15a1cc38a7ac350ad91
7
- data.tar.gz: bcbe2513a4b4916af671f5a913036e0154dd474d510351f6325a2f264d03c1dac10adc4c48bc060c40faafdc798268664c48e2c32943dd4ed3d0dcda076b7ff3
6
+ metadata.gz: 398fedeae33152e8691af37e3c32d3fc353e379839e42837779652e48d8ec2e22112eb6da0b0e24f942aaf84a727102e67d85ee573b12b5ccd42595675413a97
7
+ data.tar.gz: cf6e76fa5dc3aa9c338d8ba118c2f4107f945eebb4e5ebeaf059db4e2119abc69879ee38467452f0d6852855a72606e148c6ba0d05da4c60001cf3145376ba9f
@@ -2,7 +2,7 @@ module PandaPal::SpecHelper
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  class_methods do
5
- def with_multiple_shards(shards:, preclean_schemas: [], determine_shard: nil, transactional: true)
5
+ def with_multiple_shards(shards:, tenant_names: [], determine_shard: nil, transactional: true)
6
6
  self.use_transactional_tests = transactional
7
7
 
8
8
  original_settings = {}
@@ -26,7 +26,7 @@ module PandaPal::SpecHelper
26
26
 
27
27
  Apartment::Tenant.reload!
28
28
 
29
- clean_schemas(preclean_schemas)
29
+ clean_schemas(tenant_names)
30
30
  end
31
31
 
32
32
  after :all do
@@ -48,7 +48,7 @@ module PandaPal::SpecHelper
48
48
  end
49
49
 
50
50
  before :each do
51
- clean_schemas(preclean_schemas) unless transactional
51
+ clean_schemas(tenant_names)
52
52
 
53
53
  @each_existing_org_ids = PandaPal::Organization.pluck(:id)
54
54
 
@@ -68,9 +68,12 @@ module PandaPal::SpecHelper
68
68
  end
69
69
 
70
70
  define_method :clean_schemas do |schemas|
71
- PandaPal::Organization.where(name: schemas).delete_all
71
+ # Clean known schemas if an Organization record does not exist for them
72
+ schema_to_fqt = schemas.index_by { |s| Apartment::Tenant.split_tenant(s)[1] }
73
+ schemas_to_clean = schema_to_fqt.keys - PandaPal::Organization.pluck(:name)
72
74
 
73
- schemas.each do |schema|
75
+ schemas_to_clean.each do |schema|
76
+ # fqt = schema_to_fqt[schema]
74
77
  Apartment::Tenant.drop(schema) rescue nil
75
78
  shards.each do |k, v|
76
79
  Apartment::Tenant.drop("#{k}:#{schema}") rescue nil
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.12.0"
2
+ VERSION = "5.12.1"
3
3
  end
@@ -6,7 +6,7 @@ RSpec.describe PandaPal::Organization, type: :model do
6
6
  context "across multiple DBs" do
7
7
  with_multiple_shards(
8
8
  shards: { alt: "panda_pal_test2" },
9
- preclean_schemas: %w[on_primary on_alt],
9
+ tenant_names: %w[on_primary alt:on_alt],
10
10
  transactional: false,
11
11
  determine_shard: ->(org) { org.name.include?("alt") ? "alt" : nil }
12
12
  )
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.12.0
4
+ version: 5.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure CustomDev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-26 00:00:00.000000000 Z
11
+ date: 2024-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails