panda_pal 5.4.0.beta7 → 5.4.0.beta8

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: ac49d577cb992331095d1b740e3fb93cf2db47f84cbce2c31a06f9693a8e310f
4
- data.tar.gz: baa5c0e8ce65e510badbc1fbdb11488fd1d642a3d062ef4d6516e52e473fdd64
3
+ metadata.gz: 81c9272664817b0ae4db2101c6f1452c3745dae5df95b0d3af61608957d190d8
4
+ data.tar.gz: fa2e658b36a2b04ea717f248595f7c512dbcfc9e4992afd4c5bd7897aeeb211b
5
5
  SHA512:
6
- metadata.gz: ff14fe4000b3045cda74165143a546b0f1eef774bb04392ad1c1b23913bf31bcee169cd05e9924fe96cd026198399d00c5a83b1badfac7ecf1b50baa5853181a
7
- data.tar.gz: d9bc76487caae1258dc4825345c35fb846d96da1c0d966b375d63c3e964bbe128b1f1ad56cfdca22c9bca1d27b9be58495039b5997f32c4fb5816e78ae1a5b8a
6
+ metadata.gz: fc207504f0e723f53ee0b8b3b7ed4d5c1fc83152e4d314642aa619c95f46a57852621de2aa513cbe46bcc3a4cddd9913e6bce946aa54f85d059d3245072681fc
7
+ data.tar.gz: 1e91981cf664f4b1a2d9dbd2a471eb63a1db0ddac62f7f18d7104aae58d8663143c42e1dd591696213e4cf30fe7188af151490d76c85c0cda5c4c3180420ca3e
@@ -49,6 +49,10 @@ module PandaPal
49
49
  end
50
50
  end
51
51
 
52
+ PandaPal.resolved_extensions_for(self).each do |ext|
53
+ include ext
54
+ end
55
+
52
56
  private
53
57
 
54
58
  def create_schema
data/lib/panda_pal.rb CHANGED
@@ -13,6 +13,7 @@ module PandaPal
13
13
  @@lti_properties = {}
14
14
  @@lti_environments = {}
15
15
  @@lti_custom_params = {}
16
+ @@extensions = {}
16
17
  @@lti_private_key = nil
17
18
 
18
19
  def self.lti_options= lti_options
@@ -70,8 +71,30 @@ module PandaPal
70
71
  @@lti_private_key = k
71
72
  end
72
73
 
74
+ def self.register_extension(type, modul)
75
+ type = normalize_ext_type(type)
76
+ @@extensions[type] ||= []
77
+ @@extensions[type] << modul
78
+ end
79
+
80
+ def self.extensions_for(type)
81
+ (@@extensions[normalize_ext_type(type)] || []).uniq
82
+ end
83
+
84
+ def self.resolved_extensions_for(type)
85
+ extensions_for(type).map do |ext|
86
+ ext.to_s.safe_constantize
87
+ end.compact
88
+ end
89
+
73
90
  private
74
91
 
92
+ def self.normalize_ext_type(type)
93
+ type = type.to_s
94
+ type = "#{self.to_s}::#{type}" unless type.starts_with?('::') || type.starts_with?(self.to_s)
95
+ type
96
+ end
97
+
75
98
  def self.validate_pandapal_config!
76
99
  errors = []
77
100
  validate_lti_navigation(errors)
@@ -89,3 +112,5 @@ module PandaPal
89
112
  errors
90
113
  end
91
114
  end
115
+
116
+ PandaPal.register_extension 'Organization', '::OrganizationExtension'
@@ -43,6 +43,10 @@ module PandaPal
43
43
  ActiveSupport.on_load(:active_record) do
44
44
  if defined?(Sidekiq) && Sidekiq.server? && PandaPal::Organization.respond_to?(:sync_schedules)
45
45
  PandaPal::Organization.sync_schedules
46
+
47
+ ActiveSupport::Reloader.to_prepare do
48
+ PandaPal::Organization.sync_schedules
49
+ end
46
50
  end
47
51
  end
48
52
  end
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.4.0.beta7"
2
+ VERSION = "5.4.0.beta8"
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.4.0.beta7
4
+ version: 5.4.0.beta8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure ProServe