bridge_cache 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 69e1a863354d1451d060b1c8bb4eea5b02e86c486863a174c74db27f8f434480
4
- data.tar.gz: e05fcb0a28d3b878f8e2063f5e67586afad3a35c4f4ed7e655f928798ffe28d4
2
+ SHA1:
3
+ metadata.gz: e7e025e6406092b98777f84f9e6d970ce0609f90
4
+ data.tar.gz: 76cabdd3eddcd5a2d1c861b39c9c2572132e4376
5
5
  SHA512:
6
- metadata.gz: 127695f387295aee8f58a1a2451a014a77da732f7789bcf3187a72eab43eee4a631c667c6b10040c50b24b0f512798e90f034bdca758ce96a61670808433767e
7
- data.tar.gz: e9bfa33a5593b1c0d7262a33c2e2752cc57198a3b1c628049fbc7f8e7070611d2bd6093807792f3370a0761564afbbb0c59e957a59f7d6b490132a2fc74e7817
6
+ metadata.gz: 764436c39a31326399aba4586a0a3f854de616e5891d430361c557f638ae25f37d75391d04ef7065045d1886f976131eb30b734ec288a49806090ac9a0e68ebf
7
+ data.tar.gz: 659d2918ea470505eb3354691e702047f277917068a856873a83490eb5755aa7f31164921a882d7571c69ac560a665a12fd47f5baeed31ac64a156ba35977a09
@@ -58,6 +58,10 @@ module BridgeCache::Data
58
58
  "#{table_name.downcase}_bridge_uniq"
59
59
  end
60
60
 
61
+ def unique_column_names
62
+ %w[bridge_id]
63
+ end
64
+
61
65
  def is_active?
62
66
  where(deleted_at: nil) if column_names.include? 'deleted_at'
63
67
  end
@@ -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
- constraint_name: klass.uniq_constraint_name,
58
+ conflict_target: klass.unique_column_names,
61
59
  condition: condition_sql(klass, columns),
62
60
  columns: columns
63
61
  })
@@ -17,5 +17,8 @@ module BridgeCache
17
17
  BridgeCache::AffiliatedSubAccount.where.not(bridge_id: current_row_ids).destroy_all
18
18
  end
19
19
 
20
+ def self.unique_column_names
21
+ %w[bridge_id domain_id]
22
+ end
20
23
  end
21
24
  end
@@ -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
@@ -25,5 +25,8 @@ module BridgeCache
25
25
  row
26
26
  end
27
27
 
28
+ def self.unique_column_names
29
+ %w[bridge_id domain_id]
30
+ end
28
31
  end
29
32
  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
@@ -24,5 +24,9 @@ module BridgeCache
24
24
  def manager
25
25
  domain.owner
26
26
  end
27
+
28
+ def self.unique_column_names
29
+ %w[bridge_id sub_account_id]
30
+ end
27
31
  end
28
32
  end
@@ -1,3 +1,3 @@
1
1
  module BridgeCache
2
- VERSION = '0.3.6'.freeze
2
+ VERSION = '0.3.7'.freeze
3
3
  end
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.6
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-01 00:00:00.000000000 Z
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.7.3
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: