panda_pal 5.12.7 → 5.12.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8f1101fcff4fef0cb7d541ab3bab4cc55073e8c31ed1605990efe8a561c389b
|
4
|
+
data.tar.gz: aa35bbe30ae591094643f584b2840d5ff0404cc7655882f0f436761ba82bc9e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d22eeeef183b3f16c3000a312e57308fc432b558096f69c5ee63df9fafb3d60c09d5b253f3675257e7539a9e5ca54c464954be6e753058c6e6a01d4f765ccdb
|
7
|
+
data.tar.gz: 466e22660f22fe7d79a86d46576f1e0704d35b88332324b1f444e5b4d892c758d9331628d05153bd521489275f08d4ed00f6b12799bc491809fe791d5a784f39
|
@@ -79,11 +79,12 @@ module PandaPal
|
|
79
79
|
def encryption_key
|
80
80
|
# production environment might not have loaded secret_key_base yet.
|
81
81
|
# In that case, just read it from env.
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
82
|
+
secret_key_base = Rails.application.try(:secret_key_base)
|
83
|
+
secret_key_base ||= Rails.Rails.application.credentials.secret_key_base if Rails.version > "7.0"
|
84
|
+
secret_key_base ||= Rails.Rails.application.secrets.secret_key_base if Rails.version < "7.2"
|
85
|
+
secret_key_base ||= ENV["SECRET_KEY_BASE"]
|
86
|
+
|
87
|
+
secret_key_base[0,32]
|
87
88
|
end
|
88
89
|
|
89
90
|
def create_api(logic, expiration: nil, uses: nil, host: nil)
|
@@ -24,7 +24,9 @@ module PandaPal
|
|
24
24
|
|
25
25
|
def cache(key, &blk)
|
26
26
|
data[:cache] ||= {}
|
27
|
-
data[:cache][key]
|
27
|
+
return data[:cache][key] if data[:cache].key?(key)
|
28
|
+
|
29
|
+
data[:cache][key] = blk.call
|
28
30
|
end
|
29
31
|
|
30
32
|
def launch_params
|
@@ -214,6 +216,10 @@ module PandaPal
|
|
214
216
|
end
|
215
217
|
end
|
216
218
|
|
217
|
-
|
219
|
+
if Rails.version > '7.0'
|
220
|
+
serialize :data, coder: DataSerializer
|
221
|
+
else
|
222
|
+
serialize :data, DataSerializer
|
223
|
+
end
|
218
224
|
end
|
219
225
|
end
|
@@ -4,6 +4,26 @@ module PandaPal::Concerns
|
|
4
4
|
module AbilityHelper
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
|
+
class_methods do
|
8
|
+
def cache_on_session(method_sym)
|
9
|
+
mthd = instance_method(mthd_sym)
|
10
|
+
pmthd_sym = :"_scache_#{mthd_sym}"
|
11
|
+
|
12
|
+
alias_method pmthd_sym, mthd_sym
|
13
|
+
private pmthd_sym
|
14
|
+
|
15
|
+
class_eval <<~RUBY
|
16
|
+
def #{method_sym}()
|
17
|
+
cache_on_session(:#{pmthd_sym}) do
|
18
|
+
#{pmthd_sym}()
|
19
|
+
end
|
20
|
+
end
|
21
|
+
RUBY
|
22
|
+
|
23
|
+
method_sym
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
7
27
|
# @return PandaPal::Session
|
8
28
|
def panda_pal_session
|
9
29
|
unless defined?(@panda_pal_session) || @controller.present? || method(:panda_pal_session).owner == PandaPal::Concerns::AbilityHelper
|
data/lib/panda_pal/version.rb
CHANGED
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.
|
4
|
+
version: 5.12.9
|
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-
|
11
|
+
date: 2025-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|