panda_pal 5.12.2 → 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: 5aaa770332536d17f0a40ca1501b4b1e7887d1ce06a77ceb36f379d6177fa841
4
- data.tar.gz: 33645394c6afdc6e56a3cba902c615dc8bea904d327768193f533eff40e1ec4f
3
+ metadata.gz: 9d8ac5de141425606ffd72e020dec815ebacc8fbe840e07c94c7d390fc885f07
4
+ data.tar.gz: e2eafa4325bff57b66d3b0bba977c0318c5d3a2821d5be3ec20f04324196f2a1
5
5
  SHA512:
6
- metadata.gz: dd6acc35f33b92bb9bcb05390867c34680cd81fe02c985399ee97fa82988efe79694392024d40e8cecd4e873f606d810ed1ad9e30dad3654395355f8ec1f2a9e
7
- data.tar.gz: 79fb4db2b78e89025737ff607a062351cec69f747c61169a93c1e5759aad19672f4c14148d49229b80eef07b1d11615c75127082946576b17f49d29a6479ef56
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.
@@ -68,15 +68,14 @@ module PandaPal
68
68
 
69
69
  unless defined?(switch_org)
70
70
  def switch_org(org, &block)
71
- org = PandaPal::Organization.find_by(name: org) if org.is_a?(String)
71
+ org = PandaPal::Organization.for_apt_tenant(org) if org.is_a?(String)
72
72
  org.switch_tenant(&block)
73
73
  end
74
74
  end
75
75
 
76
76
  unless defined?(current_organization)
77
77
  def current_organization
78
- org_name = Apartment::Tenant.split_tenant(Apartment::Tenant.current)[1]
79
- PandaPal::Organization.find_by_name(org_name)
78
+ PandaPal::Organization.for_apt_tenant(Apartment::Tenant.current)
80
79
  end
81
80
  end
82
81
  end
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.12.2"
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.2
4
+ version: 5.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure CustomDev