panda_pal 5.4.3 → 5.4.4

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: b038d3fd4f84638f9417835e011bebc4ea9840dbc5cde8ac3c24f1ad35481f93
4
- data.tar.gz: 1afcd3f8d819b6bb3139e0ccd7659ed854e75b108f6f78e8c7ed2c3d9a6d22a2
3
+ metadata.gz: 3ec5567515a06e761a0cb06597380d4a10a9454f58f903466f5871757323dc7c
4
+ data.tar.gz: 418a9fe6dc99d53b6775b65c425db8c8c02aadf0adb2d92673934094bc26f3d7
5
5
  SHA512:
6
- metadata.gz: ec23ec83ae5d5f58ed67836b1126ea4387cb2cf36da0b3f9f6d2efc7c331c7be2229e1573c17c2a6d78deea9b5ad42a4a610273b62d9ed4e27feb8f6b9881403
7
- data.tar.gz: 90f8fbca45c8b5555a6506cc42f50bbc034caaa97554f84a0ecf06e4cf87b761b83476cfff51a80e90e6ecb33d06998275954edec50355a2db479854beca35e1
6
+ metadata.gz: 067dbe50e329437ada560115134fe992b3522e4bf971e73c9a22a375dd3803e5aa4897b1cf4af66fc1e31d8f905233d601a910cadaca740cd0a21a8c5d495831
7
+ data.tar.gz: 1d5ffae5cd2f7a884799a23ae73e5d3935d2f64ff1397dc506a364c34de916e317f1098de64549f5e1c15fd033090a31646f171e3b779dcb45006a7251741460
@@ -49,6 +49,10 @@ module PandaPal
49
49
  end
50
50
  end
51
51
 
52
+ def self.current
53
+ find_by_name(Apartment::Tenant.current)
54
+ end
55
+
52
56
  PandaPal.resolved_extensions_for(self).each do |ext|
53
57
  include ext
54
58
  end
@@ -198,13 +198,19 @@ module PandaPal
198
198
 
199
199
  Apartment::Tenant.switch(org.name) do
200
200
  if worker.is_a?(Proc)
201
- org.instance_exec(&worker)
201
+ return org.instance_exec(&worker)
202
202
  elsif worker.is_a?(Symbol)
203
- org.send(worker)
203
+ return org.send(worker)
204
204
  elsif worker.is_a?(String)
205
- worker.constantize.perform_async
206
- elsif worker.is_a?(Class)
207
- worker.perform_async
205
+ worker = worker.constantize
206
+ end
207
+
208
+ if worker.is_a?(Class)
209
+ if worker.respond_to?(:perform_async)
210
+ worker.perform_async
211
+ else
212
+ worker.perform_later
213
+ end
208
214
  end
209
215
  end
210
216
  end
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.4.3"
2
+ VERSION = "5.4.4"
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.3
4
+ version: 5.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure ProServe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-24 00:00:00.000000000 Z
11
+ date: 2021-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -202,7 +202,6 @@ files:
202
202
  - app/lib/lti_xml/base_platform.rb
203
203
  - app/lib/lti_xml/bridge_platform.rb
204
204
  - app/lib/lti_xml/canvas_platform.rb
205
- - app/lib/panda_pal/batch_processor.rb
206
205
  - app/lib/panda_pal/launch_url_helpers.rb
207
206
  - app/lib/panda_pal/lti_jwt_validator.rb
208
207
  - app/lib/panda_pal/misc_helper.rb
@@ -266,8 +265,6 @@ files:
266
265
  - spec/dummy/config/routes.rb
267
266
  - spec/dummy/config/secrets.yml
268
267
  - spec/dummy/db/schema.rb
269
- - spec/dummy/log/development.log
270
- - spec/dummy/log/test.log
271
268
  - spec/dummy/public/404.html
272
269
  - spec/dummy/public/422.html
273
270
  - spec/dummy/public/500.html
@@ -304,47 +301,45 @@ signing_key:
304
301
  specification_version: 4
305
302
  summary: LTI mountable engine
306
303
  test_files:
304
+ - spec/rails_helper.rb
305
+ - spec/models/panda_pal/organization_spec.rb
306
+ - spec/models/panda_pal/session_spec.rb
307
+ - spec/models/panda_pal/organization/settings_validation_spec.rb
308
+ - spec/models/panda_pal/organization/task_scheduling_spec.rb
307
309
  - spec/spec_helper.rb
308
- - spec/dummy/app/controllers/application_controller.rb
310
+ - spec/dummy/db/schema.rb
311
+ - spec/dummy/public/422.html
312
+ - spec/dummy/public/favicon.ico
313
+ - spec/dummy/public/404.html
314
+ - spec/dummy/public/500.html
315
+ - spec/dummy/Rakefile
309
316
  - spec/dummy/app/views/layouts/application.html.erb
310
- - spec/dummy/app/assets/javascripts/application.js
311
- - spec/dummy/app/assets/stylesheets/application.css
317
+ - spec/dummy/app/controllers/application_controller.rb
312
318
  - spec/dummy/app/helpers/application_helper.rb
313
- - spec/dummy/bin/rake
314
- - spec/dummy/bin/setup
315
- - spec/dummy/bin/bundle
316
- - spec/dummy/bin/rails
319
+ - spec/dummy/app/assets/stylesheets/application.css
320
+ - spec/dummy/app/assets/javascripts/application.js
317
321
  - spec/dummy/config/secrets.yml
318
- - spec/dummy/config/routes.rb
319
- - spec/dummy/config/locales/en.yml
320
- - spec/dummy/config/environments/production.rb
321
- - spec/dummy/config/environments/development.rb
322
- - spec/dummy/config/environments/test.rb
323
- - spec/dummy/config/environment.rb
324
322
  - spec/dummy/config/application.rb
325
- - spec/dummy/config/database.yml
326
- - spec/dummy/config/boot.rb
327
- - spec/dummy/config/initializers/backtrace_silencers.rb
328
- - spec/dummy/config/initializers/mime_types.rb
329
- - spec/dummy/config/initializers/filter_parameter_logging.rb
330
323
  - spec/dummy/config/initializers/session_store.rb
331
324
  - spec/dummy/config/initializers/wrap_parameters.rb
332
- - spec/dummy/config/initializers/cookies_serializer.rb
333
325
  - spec/dummy/config/initializers/inflections.rb
334
- - spec/dummy/config.ru
335
- - spec/dummy/Rakefile
336
- - spec/dummy/public/favicon.ico
337
- - spec/dummy/public/422.html
338
- - spec/dummy/public/500.html
339
- - spec/dummy/public/404.html
340
- - spec/dummy/db/schema.rb
341
- - spec/dummy/log/test.log
342
- - spec/dummy/log/development.log
326
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
327
+ - spec/dummy/config/initializers/mime_types.rb
328
+ - spec/dummy/config/initializers/backtrace_silencers.rb
329
+ - spec/dummy/config/initializers/cookies_serializer.rb
330
+ - spec/dummy/config/environments/development.rb
331
+ - spec/dummy/config/environments/test.rb
332
+ - spec/dummy/config/environments/production.rb
333
+ - spec/dummy/config/database.yml
334
+ - spec/dummy/config/boot.rb
335
+ - spec/dummy/config/routes.rb
336
+ - spec/dummy/config/environment.rb
337
+ - spec/dummy/config/locales/en.yml
343
338
  - spec/dummy/README.rdoc
344
- - spec/models/panda_pal/organization/settings_validation_spec.rb
345
- - spec/models/panda_pal/organization/task_scheduling_spec.rb
346
- - spec/models/panda_pal/session_spec.rb
347
- - spec/models/panda_pal/organization_spec.rb
348
- - spec/factories/panda_pal_sessions.rb
339
+ - spec/dummy/config.ru
340
+ - spec/dummy/bin/bundle
341
+ - spec/dummy/bin/rake
342
+ - spec/dummy/bin/setup
343
+ - spec/dummy/bin/rails
349
344
  - spec/factories/panda_pal_organizations.rb
350
- - spec/rails_helper.rb
345
+ - spec/factories/panda_pal_sessions.rb
@@ -1,41 +0,0 @@
1
- module PandaPal
2
- # An array that "processes" after so many items are added.
3
- #
4
- # Example Usage:
5
- # batches = BatchProcessor.new(of: 1000) do |batch|
6
- # # Process the batch somehow
7
- # end
8
- # enumerator_of_some_kind.each { |item| batches << item }
9
- # batches.flush
10
- class BatchProcessor
11
- attr_reader :batch_size
12
-
13
- def initialize(of: 1000, &blk)
14
- @batch_size = of
15
- @block = blk
16
- @current_batch = []
17
- end
18
-
19
- def <<(item)
20
- @current_batch << item
21
- process_batch if @current_batch.count >= batch_size
22
- end
23
-
24
- def add_all(items)
25
- items.each do |i|
26
- self << i
27
- end
28
- end
29
-
30
- def flush
31
- process_batch if @current_batch.present?
32
- end
33
-
34
- protected
35
-
36
- def process_batch
37
- @block.call(@current_batch)
38
- @current_batch = []
39
- end
40
- end
41
- end
@@ -1,56 +0,0 @@
1
-  (1.2ms) DROP DATABASE IF EXISTS "panda_pal_development"
2
-  (0.2ms) DROP DATABASE IF EXISTS "panda_pal_test"
3
-  (82.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
4
-  (11.8ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
5
-  (0.3ms) SELECT pg_try_advisory_lock(7878782013693407355);
6
-  (2.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
7
- ActiveRecord::InternalMetadata Load (2.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
8
-  (0.2ms) BEGIN
9
- SQL (3.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-04-30 16:44:35.134620"], ["updated_at", "2020-04-30 16:44:35.134620"]]
10
-  (0.6ms) COMMIT
11
-  (0.3ms) SELECT pg_advisory_unlock(7878782013693407355)
12
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
13
-  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
14
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
15
-  (211.6ms) DROP DATABASE IF EXISTS "panda_pal_development"
16
-  (247.6ms) DROP DATABASE IF EXISTS "panda_pal_test"
17
- SQL (0.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
18
-  (8.5ms) DROP TABLE IF EXISTS "panda_pal_organizations" CASCADE
19
-  (14.4ms) CREATE TABLE "panda_pal_organizations" ("id" bigserial primary key, "name" character varying, "key" character varying, "secret" character varying, "canvas_account_id" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "salesforce_id" character varying, "encrypted_settings" text, "encrypted_settings_iv" character varying)
20
-  (2.5ms) CREATE UNIQUE INDEX "index_panda_pal_organizations_on_key" ON "panda_pal_organizations" ("key")
21
-  (2.6ms) CREATE UNIQUE INDEX "index_panda_pal_organizations_on_name" ON "panda_pal_organizations" ("name")
22
-  (0.2ms) DROP TABLE IF EXISTS "panda_pal_sessions" CASCADE
23
-  (6.5ms) CREATE TABLE "panda_pal_sessions" ("id" bigserial primary key, "session_key" character varying, "data" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "panda_pal_organization_id" integer)
24
-  (1.9ms) CREATE INDEX "index_panda_pal_sessions_on_panda_pal_organization_id" ON "panda_pal_sessions" ("panda_pal_organization_id")
25
-  (2.5ms) CREATE UNIQUE INDEX "index_panda_pal_sessions_on_session_key" ON "panda_pal_sessions" ("session_key")
26
-  (3.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
27
-  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
28
-  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171205194657)
29
-  (47.2ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
30
- ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
31
-  (0.4ms) BEGIN
32
- SQL (0.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-04-30 17:00:14.956327"], ["updated_at", "2020-04-30 17:00:14.956327"]]
33
-  (0.5ms) COMMIT
34
- ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
35
-  (0.1ms) BEGIN
36
-  (0.2ms) COMMIT
37
- SQL (0.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
38
-  (0.3ms) DROP TABLE IF EXISTS "panda_pal_organizations" CASCADE
39
-  (52.5ms) CREATE TABLE "panda_pal_organizations" ("id" bigserial primary key, "name" character varying, "key" character varying, "secret" character varying, "canvas_account_id" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "salesforce_id" character varying, "encrypted_settings" text, "encrypted_settings_iv" character varying)
40
-  (2.4ms) CREATE UNIQUE INDEX "index_panda_pal_organizations_on_key" ON "panda_pal_organizations" ("key")
41
-  (1.9ms) CREATE UNIQUE INDEX "index_panda_pal_organizations_on_name" ON "panda_pal_organizations" ("name")
42
-  (0.2ms) DROP TABLE IF EXISTS "panda_pal_sessions" CASCADE
43
-  (6.0ms) CREATE TABLE "panda_pal_sessions" ("id" bigserial primary key, "session_key" character varying, "data" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "panda_pal_organization_id" integer)
44
-  (1.8ms) CREATE INDEX "index_panda_pal_sessions_on_panda_pal_organization_id" ON "panda_pal_sessions" ("panda_pal_organization_id")
45
-  (1.8ms) CREATE UNIQUE INDEX "index_panda_pal_sessions_on_session_key" ON "panda_pal_sessions" ("session_key")
46
-  (4.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
47
-  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
48
-  (4.0ms) INSERT INTO "schema_migrations" (version) VALUES (20171205194657)
49
-  (6.5ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
50
- ActiveRecord::InternalMetadata Load (2.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
51
-  (0.1ms) BEGIN
52
- SQL (5.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-04-30 17:00:15.126316"], ["updated_at", "2020-04-30 17:00:15.126316"]]
53
-  (0.4ms) COMMIT
54
- ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
55
-  (0.2ms) BEGIN
56
-  (0.1ms) COMMIT