bridge_cache 0.0.14 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/lib/bridge_cache/jobs/import_check.rb +1 -1
- data/app/lib/bridge_cache/jobs/import_start.rb +1 -0
- data/app/models/bridge_cache/affiliated_sub_account.rb +16 -0
- data/app/models/bridge_cache/course_template.rb +2 -0
- data/db/migrate/20171017211850_create_affiliated_sub_accounts.rb +15 -0
- data/lib/bridge_cache/version.rb +1 -1
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aabfd5b6e097a79f0d6e9a801d1b640a93665bb0
|
4
|
+
data.tar.gz: e86a1c866dd4a53dd2adcfa4f2d5c1bdde3cfac6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d34d52bb7ff2ce2cb3515c3de155876842b6f1e1e5acadb51d5cc6fb90a6e6068e7621173d3663df8eacc018bb2cffde4fdce7d99549396d4735b7b159e0fa0d
|
7
|
+
data.tar.gz: 45e06a4115b2e60ecd199cc8f470e9fabca9d21de8688c051d64365df367f379433b9513f264317b3cbbca70a0d361cf3cc8332ef333f79ca686fdc3f275cedb
|
@@ -9,7 +9,7 @@ module BridgeCache::Jobs
|
|
9
9
|
BridgeCache::Jobs::ImportData.set(queue: self.queue_name).perform_later(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain)
|
10
10
|
elsif remote_data.status == BridgeBlueprint::Constants::STATUS_PENDING
|
11
11
|
BridgeCache::Jobs::ImportCheck.set(queue: self.queue_name, wait: 30.seconds).perform_later(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain)
|
12
|
-
elsif remote_data.status == BridgeBlueprint::Constants::STATUS_FAILED || remote_data.status ==
|
12
|
+
elsif remote_data.status == BridgeBlueprint::Constants::STATUS_FAILED || remote_data.status == BridgeBlueprint::Constants::STATUS_NOT_FOUND
|
13
13
|
raise 'Bridge data dump download failed'
|
14
14
|
end
|
15
15
|
end
|
@@ -4,6 +4,7 @@ module BridgeCache::Jobs
|
|
4
4
|
|
5
5
|
def perform(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain = [])
|
6
6
|
data = BridgeBlueprint::RemoteData.new(bridge_base_url, bridge_api_key, bridge_api_secret)
|
7
|
+
models = (['domain', 'affiliated_sub_account'] + models).uniq
|
7
8
|
data.start_data_report
|
8
9
|
BridgeCache::Jobs::ImportCheck
|
9
10
|
.set(queue: self.queue_name, wait: 30.seconds)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module BridgeCache
|
2
|
+
class AffiliatedSubAccount < ActiveRecord::Base
|
3
|
+
extend BridgeCache::Data::BridgeModel
|
4
|
+
|
5
|
+
before_save :fix_item_type
|
6
|
+
|
7
|
+
belongs_to :item, polymorphic: true, optional: true
|
8
|
+
belongs_to :domain, foreign_key: :domain_id, primary_key: :bridge_id, class_name: 'BridgeCache::Domain', optional: true
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def fix_item_type
|
13
|
+
self.item_type = "BridgeCache::#{self.item_type}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -7,6 +7,8 @@ module BridgeCache
|
|
7
7
|
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: :bridge_id, class_name: 'BridgeCache::Domain', optional: true
|
8
8
|
has_many :enrollments, foreign_key: :course_template_id, primary_key: :bridge_id, class_name: 'BridgeCache::Enrollment'
|
9
9
|
has_many :group_enrollments, foreign_key: :course_template_id, primary_key: :bridge_id, class_name: 'BridgeCache::GroupEnrollment'
|
10
|
+
has_many :affiliated_sub_accounts, primary_key: :bridge_id, class_name: 'BridgeCache::AffiliatedSubAccount', as: :item
|
11
|
+
has_many :domains, through: :affiliated_sub_accounts
|
10
12
|
|
11
13
|
end
|
12
14
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateAffiliatedSubAccounts < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
create_table :bridge_cache_affiliated_sub_accounts do |t|
|
4
|
+
t.integer :bridge_id
|
5
|
+
t.integer :item_id
|
6
|
+
t.string :item_type
|
7
|
+
t.integer :domain_id
|
8
|
+
t.datetime :deleted_at
|
9
|
+
t.datetime :created_at
|
10
|
+
t.datetime :updated_at
|
11
|
+
t.integer :state
|
12
|
+
t.integer :sources_count
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/bridge_cache/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bridge_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jshaffer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: shoulda-matchers
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
167
181
|
description: A mountable engine for bridge data storage
|
168
182
|
email:
|
169
183
|
- jshaffer@instructure.com
|
@@ -187,6 +201,7 @@ files:
|
|
187
201
|
- app/lib/bridge_cache/plugins/csv_dump.rb
|
188
202
|
- app/lib/bridge_cache/plugins/data_transform.rb
|
189
203
|
- app/lib/bridge_cache/utils/worker_helper.rb
|
204
|
+
- app/models/bridge_cache/affiliated_sub_account.rb
|
190
205
|
- app/models/bridge_cache/application_record.rb
|
191
206
|
- app/models/bridge_cache/course_template.rb
|
192
207
|
- app/models/bridge_cache/custom_field.rb
|
@@ -222,6 +237,7 @@ files:
|
|
222
237
|
- db/migrate/20170523164248_create_bridge_cache_group_enrollments.rb
|
223
238
|
- db/migrate/20170523165014_create_bridge_cache_memberships.rb
|
224
239
|
- db/migrate/20170615145554_create_bridge_cache_learner_custom_field_values.rb
|
240
|
+
- db/migrate/20171017211850_create_affiliated_sub_accounts.rb
|
225
241
|
- lib/bridge_cache.rb
|
226
242
|
- lib/bridge_cache/engine.rb
|
227
243
|
- lib/bridge_cache/version.rb
|
@@ -246,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
262
|
version: '0'
|
247
263
|
requirements: []
|
248
264
|
rubyforge_project:
|
249
|
-
rubygems_version: 2.
|
265
|
+
rubygems_version: 2.6.13
|
250
266
|
signing_key:
|
251
267
|
specification_version: 4
|
252
268
|
summary: A mountable engine for bridge data storage
|