panda_pal 5.12.1 → 5.12.3

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: c7b257eddedb1431e4a8030cae79245ef3c0da635ac47cd7e3d1b7ac223d630c
4
- data.tar.gz: cff44cd6c69723032155a0e82a952f1ceaec1bbcc991014ab5ea5fd75a3404db
3
+ metadata.gz: 9d8ac5de141425606ffd72e020dec815ebacc8fbe840e07c94c7d390fc885f07
4
+ data.tar.gz: e2eafa4325bff57b66d3b0bba977c0318c5d3a2821d5be3ec20f04324196f2a1
5
5
  SHA512:
6
- metadata.gz: 398fedeae33152e8691af37e3c32d3fc353e379839e42837779652e48d8ec2e22112eb6da0b0e24f942aaf84a727102e67d85ee573b12b5ccd42595675413a97
7
- data.tar.gz: cf6e76fa5dc3aa9c338d8ba118c2f4107f945eebb4e5ebeaf059db4e2119abc69879ee38467452f0d6852855a72606e148c6ba0d05da4c60001cf3145376ba9f
6
+ metadata.gz: 4624ae3e064ca1547951a9171503d3e13170d92370b50557f8473e69655fc46b38748e39cfb920990d8a1b9fd38c30c4b7972e8584faafbcf0ea9481cc707794
7
+ data.tar.gz: db2597130346e0c0afe6739200b61cb14a2c1f8441a038c1cba7426f653e65b987757b94bf2ef22c8d727b712754135d87e0c7c8326371ab5be407a180f8d1ca
@@ -71,6 +71,11 @@ module PandaPal
71
71
  end
72
72
  end
73
73
 
74
+ def self.for_apt_tenant(schema)
75
+ shard, schema = Apartment::Tenant.split_tenant(schema)
76
+ find_by(name: schema)
77
+ end
78
+
74
79
  def encryption_key
75
80
  # production environment might not have loaded secret_key_base yet.
76
81
  # In that case, just read it from env.
@@ -66,9 +66,16 @@ module PandaPal
66
66
  end
67
67
  end
68
68
 
69
+ unless defined?(switch_org)
70
+ def switch_org(org, &block)
71
+ org = PandaPal::Organization.for_apt_tenant(org) if org.is_a?(String)
72
+ org.switch_tenant(&block)
73
+ end
74
+ end
75
+
69
76
  unless defined?(current_organization)
70
77
  def current_organization
71
- PandaPal::Organization.find_by_name(Apartment::Tenant.current)
78
+ PandaPal::Organization.for_apt_tenant(Apartment::Tenant.current)
72
79
  end
73
80
  end
74
81
  end
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.12.1"
2
+ VERSION = "5.12.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.12.1
4
+ version: 5.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure CustomDev