panda_pal 5.4.6 → 5.4.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab247586547b242a21faf1f5d26b8c58eee77f0893bca00c68b36c984f7d646e
|
4
|
+
data.tar.gz: 8929cb3f413b2bd3870b6f92fd7c73eba886e0d5f0c403e46d383d949b213b5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a446ff7233316b5bdd0629b8529391d92c58a6596bb5cdffa166c5f5727e50e27c6ebd11781b45abcbc0659a8f1b01349425d165dfbb7cefe5e98a613778ee00
|
7
|
+
data.tar.gz: 7dd81c73ae5d4c704289ecb172f5f4342531a2998a6e68d568dafc8ac88494d0f7e0638b35885a09c682dbac2cd9d670f1d984e9f9644e6b096f69bb5db5ed4d
|
@@ -8,6 +8,34 @@ module PandaPal
|
|
8
8
|
self.session_key ||= SecureRandom.urlsafe_base64(60)
|
9
9
|
end
|
10
10
|
|
11
|
-
|
11
|
+
class DataSerializer
|
12
|
+
def self.load(str)
|
13
|
+
return nil unless str.present?
|
14
|
+
begin
|
15
|
+
parsed = JSON.parse(str)
|
16
|
+
rescue JSON::ParserError
|
17
|
+
parsed = yaml_load(str)
|
18
|
+
end
|
19
|
+
parsed.is_a?(Hash) ? HashWithIndifferentAccess.new(parsed) : parsed
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.dump(obj)
|
23
|
+
JSON.dump(obj)
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
if YAML.respond_to?(:unsafe_load)
|
29
|
+
def self.yaml_load(payload)
|
30
|
+
YAML.unsafe_load(payload)
|
31
|
+
end
|
32
|
+
else
|
33
|
+
def self.yaml_load(payload)
|
34
|
+
YAML.load(payload)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
serialize :data, DataSerializer
|
12
40
|
end
|
13
41
|
end
|
@@ -18,6 +18,8 @@ class RemoveOldOrganizationSettings < PandaPal::MiscHelper::MigrationClass
|
|
18
18
|
#PandaPal::Organization.connection.schema_cache.clear!
|
19
19
|
#PandaPal::Organization.reset_column_information
|
20
20
|
PandaPal::Organization.find_each do |o|
|
21
|
+
next unless o.old_settings.present?
|
22
|
+
|
21
23
|
# Would like to just be able to do this:
|
22
24
|
# o.settings = YAML.load(o.old_settings)
|
23
25
|
# o.save!
|
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.4.
|
4
|
+
version: 5.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instructure ProServe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|