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: 47e93c2f05e4078784f066642ed837e56c60cab9d342a2b9cd0d5e72192a248c
4
- data.tar.gz: 4bd5d5e668b0a6a4cd069234170d460bfc44bdd80bc2b0b872b1f00cdbe77339
3
+ metadata.gz: ab247586547b242a21faf1f5d26b8c58eee77f0893bca00c68b36c984f7d646e
4
+ data.tar.gz: 8929cb3f413b2bd3870b6f92fd7c73eba886e0d5f0c403e46d383d949b213b5d
5
5
  SHA512:
6
- metadata.gz: 67905790789c0a503b453c09abd1255d7b4720a313cc60be816db7cf58806e878b52933eb749f346b78291780d17632bb6cabed66581426614a3e4b5f999b653
7
- data.tar.gz: 913aa637b83f0de8d664dfbb811ce379a61c4fae6cc7c64c79eab9f95c167b0428fff77bb83bb3faed8880d129605f5026a085f1f62960b7755176c1df392972
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
- serialize :data, Hash
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!
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.4.6"
2
+ VERSION = "5.4.9"
3
3
  end
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.6
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-04-25 00:00:00.000000000 Z
11
+ date: 2022-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails