bridge_cache 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/lib/bridge_cache/data/bridge_model.rb +4 -0
- data/app/lib/bridge_cache/plugins/csv_dump.rb +1 -3
- data/app/models/bridge_cache/affiliated_sub_account.rb +3 -0
- data/app/models/bridge_cache/course_template.rb +4 -0
- data/app/models/bridge_cache/custom_field.rb +4 -0
- data/app/models/bridge_cache/enrollment_profile.rb +3 -0
- data/app/models/bridge_cache/grant.rb +4 -0
- data/app/models/bridge_cache/group.rb +4 -0
- data/app/models/bridge_cache/live_course.rb +4 -0
- data/app/models/bridge_cache/live_course_session.rb +4 -0
- data/app/models/bridge_cache/user.rb +4 -0
- data/lib/bridge_cache/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e7e025e6406092b98777f84f9e6d970ce0609f90
|
4
|
+
data.tar.gz: 76cabdd3eddcd5a2d1c861b39c9c2572132e4376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 764436c39a31326399aba4586a0a3f854de616e5891d430361c557f638ae25f37d75391d04ef7065045d1886f976131eb30b734ec288a49806090ac9a0e68ebf
|
7
|
+
data.tar.gz: 659d2918ea470505eb3354691e702047f277917068a856873a83490eb5755aa7f31164921a882d7571c69ac560a665a12fd47f5baeed31ac64a156ba35977a09
|
@@ -51,13 +51,11 @@ module BridgeCache::Plugins
|
|
51
51
|
dump_rows([instance])
|
52
52
|
end
|
53
53
|
|
54
|
-
private
|
55
|
-
|
56
54
|
def self.perform_bulk_import(klass, columns, rows)
|
57
55
|
return if rows.empty?
|
58
56
|
columns = columns.dup
|
59
57
|
klass.import(columns, rows, validate: false, on_duplicate_key_update: {
|
60
|
-
|
58
|
+
conflict_target: klass.unique_column_names,
|
61
59
|
condition: condition_sql(klass, columns),
|
62
60
|
columns: columns
|
63
61
|
})
|
@@ -17,5 +17,9 @@ module BridgeCache
|
|
17
17
|
.where('bridge_cache_affiliated_sub_accounts.domain_id = ? OR bridge_cache_course_templates.sub_account_id = ?', domain_id, domain_id)
|
18
18
|
.references(:domains)
|
19
19
|
end
|
20
|
+
|
21
|
+
def self.unique_column_names
|
22
|
+
%w[bridge_id sub_account_id]
|
23
|
+
end
|
20
24
|
end
|
21
25
|
end
|
@@ -4,5 +4,9 @@ module BridgeCache
|
|
4
4
|
|
5
5
|
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
6
6
|
has_many :learner_custom_field_values, primary_key: BridgeCache.primary_key, foreign_key: :custom_field_id, class_name: BridgeCache::LearnerCustomFieldValue.name
|
7
|
+
|
8
|
+
def self.unique_column_names
|
9
|
+
%w[bridge_id domain_id]
|
10
|
+
end
|
7
11
|
end
|
8
12
|
end
|
@@ -4,5 +4,9 @@ module BridgeCache
|
|
4
4
|
|
5
5
|
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
6
6
|
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
7
|
+
|
8
|
+
def self.unique_column_names
|
9
|
+
%w[bridge_id domain_id]
|
10
|
+
end
|
7
11
|
end
|
8
12
|
end
|
@@ -9,5 +9,9 @@ module BridgeCache
|
|
9
9
|
has_many :group_enrollments, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::GroupEnrollment.name
|
10
10
|
has_many :memberships, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Membership.name
|
11
11
|
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
12
|
+
|
13
|
+
def self.unique_column_names
|
14
|
+
%w[bridge_id domain_id]
|
15
|
+
end
|
12
16
|
end
|
13
17
|
end
|
@@ -14,5 +14,9 @@ module BridgeCache
|
|
14
14
|
.where('bridge_cache_affiliated_sub_accounts.domain_id = ? OR bridge_cache_live_courses.sub_account_id = ?', domain_id, domain_id)
|
15
15
|
.references(:domains)
|
16
16
|
end
|
17
|
+
|
18
|
+
def self.unique_column_names
|
19
|
+
%w[bridge_id domain_id]
|
20
|
+
end
|
17
21
|
end
|
18
22
|
end
|
@@ -10,5 +10,9 @@ module BridgeCache
|
|
10
10
|
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
11
11
|
belongs_to :live_course, foreign_key: :live_course_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourse.name, optional: true
|
12
12
|
has_many :live_course_session_registrations, foreign_key: :live_course_session_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourseSessionRegistration.name
|
13
|
+
|
14
|
+
def self.unique_column_names
|
15
|
+
%w[bridge_id domain_id]
|
16
|
+
end
|
13
17
|
end
|
14
18
|
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.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jshaffer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-import
|
@@ -376,8 +376,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
376
376
|
version: '0'
|
377
377
|
requirements: []
|
378
378
|
rubyforge_project:
|
379
|
-
rubygems_version: 2.
|
379
|
+
rubygems_version: 2.6.14
|
380
380
|
signing_key:
|
381
381
|
specification_version: 4
|
382
382
|
summary: A mountable engine for bridge data storage
|
383
383
|
test_files: []
|
384
|
+
has_rdoc:
|