bridge_cache 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/bridge_cache/affiliated_sub_account.rb +1 -1
- data/app/models/bridge_cache/bridge_base_model.rb +6 -1
- data/app/models/bridge_cache/course_template.rb +7 -7
- data/app/models/bridge_cache/custom_field.rb +2 -2
- data/app/models/bridge_cache/domain.rb +9 -9
- data/app/models/bridge_cache/enrollment.rb +2 -2
- data/app/models/bridge_cache/grant.rb +2 -2
- data/app/models/bridge_cache/group.rb +5 -5
- data/app/models/bridge_cache/group_enrollment.rb +2 -2
- data/app/models/bridge_cache/learner_custom_field_value.rb +2 -2
- data/app/models/bridge_cache/live_course.rb +5 -5
- data/app/models/bridge_cache/live_course_enrollment.rb +3 -3
- data/app/models/bridge_cache/live_course_session.rb +4 -4
- data/app/models/bridge_cache/live_course_session_registration.rb +4 -4
- data/app/models/bridge_cache/membership.rb +2 -2
- data/app/models/bridge_cache/program.rb +6 -6
- data/app/models/bridge_cache/program_enrollment.rb +2 -2
- data/app/models/bridge_cache/program_group_enrollment.rb +2 -2
- data/app/models/bridge_cache/program_item.rb +1 -1
- data/app/models/bridge_cache/tag.rb +1 -1
- data/app/models/bridge_cache/tagging.rb +2 -2
- data/app/models/bridge_cache/user.rb +12 -12
- data/lib/bridge_cache/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a62895e07fe22403a7cafb67ecfadd70442215b6
|
4
|
+
data.tar.gz: 18b13e6e422ea434da2f56beaebeda253151bef1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa1f74aed213baa2ee7291d18d3c83bffee029f47a6e88296dc1e5d868dd3e6a4dc1e7fcfa1f9fa06fc8aabfe6d115e312385de589afde26e47651e9ee39cbe0
|
7
|
+
data.tar.gz: c2cc0c9a9fcf13fef15161068cc5bc13d3a21304ff696e76d5d60cd3d66b1b6476f05cd9b097d63333afcd97e151eb285e778879c40ef1ae311cdc0fe3e28e5f
|
@@ -5,7 +5,7 @@ module BridgeCache
|
|
5
5
|
before_save :fix_item_type
|
6
6
|
|
7
7
|
belongs_to :item, polymorphic: true, optional: true
|
8
|
-
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name:
|
8
|
+
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
9
9
|
|
10
10
|
private
|
11
11
|
|
@@ -2,8 +2,13 @@ module BridgeCache
|
|
2
2
|
class BridgeBaseModel < ActiveRecord::Base
|
3
3
|
self.abstract_class = true
|
4
4
|
|
5
|
+
BRIDGE_ID = 'bridge_id'.freeze
|
6
|
+
OWNER_ID = 'owner_id'.freeze
|
7
|
+
PARENT_ID = 'parent_id'.freeze
|
8
|
+
DOMAIN_ID = 'domain_id'.freeze
|
9
|
+
|
5
10
|
def bridge_id
|
6
|
-
if self.class.column_names.include?
|
11
|
+
if self.class.column_names.include? BRIDGE_ID
|
7
12
|
self[:bridge_id]
|
8
13
|
else
|
9
14
|
id
|
@@ -2,14 +2,14 @@ module BridgeCache
|
|
2
2
|
class CourseTemplate < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
6
|
-
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name:
|
7
|
-
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name:
|
8
|
-
has_many :enrollments, foreign_key: :course_template_id, primary_key: BridgeCache.primary_key, class_name:
|
9
|
-
has_many :group_enrollments, foreign_key: :course_template_id, primary_key: BridgeCache.primary_key, class_name:
|
10
|
-
has_many :affiliated_sub_accounts, primary_key: BridgeCache.primary_key, class_name:
|
5
|
+
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
6
|
+
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
7
|
+
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
8
|
+
has_many :enrollments, foreign_key: :course_template_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Enrollment.name
|
9
|
+
has_many :group_enrollments, foreign_key: :course_template_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::GroupEnrollment.name
|
10
|
+
has_many :affiliated_sub_accounts, primary_key: BridgeCache.primary_key, class_name: BridgeCache::AffiliatedSubAccount.name, as: :item
|
11
11
|
has_many :domains, through: :affiliated_sub_accounts
|
12
|
-
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name:
|
12
|
+
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
13
13
|
|
14
14
|
def self.for_domain(domain_id)
|
15
15
|
includes(:domains)
|
@@ -2,8 +2,8 @@ module BridgeCache
|
|
2
2
|
class CustomField < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name:
|
6
|
-
has_many :learner_custom_field_values, primary_key: BridgeCache.primary_key, foreign_key: :custom_field_id, class_name:
|
5
|
+
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
6
|
+
has_many :learner_custom_field_values, primary_key: BridgeCache.primary_key, foreign_key: :custom_field_id, class_name: BridgeCache::LearnerCustomFieldValue.name
|
7
7
|
|
8
8
|
end
|
9
9
|
end
|
@@ -2,18 +2,18 @@ module BridgeCache
|
|
2
2
|
class Domain < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
has_many :domain_children, primary_key: BridgeCache.primary_key, foreign_key:
|
6
|
-
belongs_to :domain_parent, primary_key: BridgeCache.primary_key, foreign_key:
|
5
|
+
has_many :domain_children, primary_key: BridgeCache.primary_key, foreign_key: PARENT_ID, class_name: BridgeCache::Domain.name
|
6
|
+
belongs_to :domain_parent, primary_key: BridgeCache.primary_key, foreign_key: PARENT_ID, class_name: BridgeCache::Domain.name, optional: true
|
7
7
|
|
8
|
-
has_many :domain_ownees, primary_key: BridgeCache.primary_key, foreign_key:
|
9
|
-
belongs_to :domain_owner, primary_key: BridgeCache.primary_key, foreign_key:
|
8
|
+
has_many :domain_ownees, primary_key: BridgeCache.primary_key, foreign_key: OWNER_ID, class_name: BridgeCache::Domain.name
|
9
|
+
belongs_to :domain_owner, primary_key: BridgeCache.primary_key, foreign_key: OWNER_ID, class_name: BridgeCache::Domain.name, optional: true
|
10
10
|
|
11
|
-
has_many :programs, primary_key: BridgeCache.primary_key, foreign_key:
|
12
|
-
has_many :course_templates, primary_key: BridgeCache.primary_key, foreign_key:
|
13
|
-
has_many :custom_fields, primary_key: BridgeCache.primary_key, foreign_key:
|
14
|
-
has_many :grants, primary_key: BridgeCache.primary_key, foreign_key:
|
11
|
+
has_many :programs, primary_key: BridgeCache.primary_key, foreign_key: DOMAIN_ID, class_name: BridgeCache::Program.name
|
12
|
+
has_many :course_templates, primary_key: BridgeCache.primary_key, foreign_key: DOMAIN_ID, class_name: BridgeCache::CourseTemplate.name
|
13
|
+
has_many :custom_fields, primary_key: BridgeCache.primary_key, foreign_key: DOMAIN_ID, class_name: BridgeCache::CustomField.name
|
14
|
+
has_many :grants, primary_key: BridgeCache.primary_key, foreign_key: DOMAIN_ID, class_name: BridgeCache::Grant.name
|
15
15
|
|
16
|
-
belongs_to :owner, class_name:
|
16
|
+
belongs_to :owner, class_name: BridgeCache::User.name
|
17
17
|
|
18
18
|
serialize :config
|
19
19
|
|
@@ -6,8 +6,8 @@ module BridgeCache
|
|
6
6
|
joins(:course_template).merge(BridgeCache::CourseTemplate.for_domain(domain_id))
|
7
7
|
end
|
8
8
|
|
9
|
-
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
10
|
-
belongs_to :course_template, foreign_key: :course_template_id, primary_key: BridgeCache.primary_key, class_name:
|
9
|
+
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
10
|
+
belongs_to :course_template, foreign_key: :course_template_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::CourseTemplate.name, optional: true
|
11
11
|
|
12
12
|
end
|
13
13
|
end
|
@@ -2,8 +2,8 @@ module BridgeCache
|
|
2
2
|
class Grant < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
6
|
-
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name:
|
5
|
+
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
6
|
+
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
7
7
|
|
8
8
|
end
|
9
9
|
end
|
@@ -4,11 +4,11 @@ module BridgeCache
|
|
4
4
|
|
5
5
|
self.inheritance_column = nil
|
6
6
|
|
7
|
-
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
8
|
-
has_many :program_group_enrollments, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name:
|
9
|
-
has_many :group_enrollments, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name:
|
10
|
-
has_many :memberships, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name:
|
11
|
-
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name:
|
7
|
+
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
8
|
+
has_many :program_group_enrollments, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::ProgramGroupEnrollment.name
|
9
|
+
has_many :group_enrollments, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::GroupEnrollment.name
|
10
|
+
has_many :memberships, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Membership.name
|
11
|
+
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
12
12
|
|
13
13
|
end
|
14
14
|
end
|
@@ -6,8 +6,8 @@ module BridgeCache
|
|
6
6
|
joins(:course_template).where(bridge_cache_course_templates: {domain_id: domain_id})
|
7
7
|
end
|
8
8
|
|
9
|
-
belongs_to :group, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name:
|
10
|
-
belongs_to :course_template, foreign_key: :course_template_id, primary_key: BridgeCache.primary_key, class_name:
|
9
|
+
belongs_to :group, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Group.name, optional: true
|
10
|
+
belongs_to :course_template, foreign_key: :course_template_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::CourseTemplate.name, optional: true
|
11
11
|
|
12
12
|
end
|
13
13
|
end
|
@@ -6,8 +6,8 @@ module BridgeCache
|
|
6
6
|
joins(:user).where(bridge_cache_users: {domain_id: domain_id})
|
7
7
|
end
|
8
8
|
|
9
|
-
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
10
|
-
belongs_to :custom_field, foreign_key: :custom_field_id, primary_key: BridgeCache.primary_key, class_name:
|
9
|
+
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
10
|
+
belongs_to :custom_field, foreign_key: :custom_field_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::CustomField.name, optional: true
|
11
11
|
|
12
12
|
end
|
13
13
|
end
|
@@ -2,11 +2,11 @@ module BridgeCache
|
|
2
2
|
class LiveCourse < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
6
|
-
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name:
|
7
|
-
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name:
|
8
|
-
has_many :live_course_enrollments, foreign_key: :live_course_id, primary_key: BridgeCache.primary_key, class_name:
|
9
|
-
has_many :affiliated_sub_accounts, primary_key: BridgeCache.primary_key, class_name:
|
5
|
+
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
6
|
+
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
7
|
+
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
8
|
+
has_many :live_course_enrollments, foreign_key: :live_course_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourseEnrollment.name
|
9
|
+
has_many :affiliated_sub_accounts, primary_key: BridgeCache.primary_key, class_name: BridgeCache::AffiliatedSubAccount.name, as: :item
|
10
10
|
has_many :domains, through: :affiliated_sub_accounts
|
11
11
|
|
12
12
|
def self.for_domain(domain_id)
|
@@ -6,9 +6,9 @@ module BridgeCache
|
|
6
6
|
joins(:live_course).merge(BridgeCache::LiveCourse.for_domain(domain_id))
|
7
7
|
end
|
8
8
|
|
9
|
-
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
10
|
-
belongs_to :live_course, foreign_key: :live_course_id, primary_key: BridgeCache.primary_key, class_name:
|
11
|
-
has_many :live_course_session_registrations, foreign_key: :live_course_enrollment_id, primary_key: BridgeCache.primary_key, class_name:
|
9
|
+
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
10
|
+
belongs_to :live_course, foreign_key: :live_course_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourse.name, optional: true
|
11
|
+
has_many :live_course_session_registrations, foreign_key: :live_course_enrollment_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourseSessionRegistration.name
|
12
12
|
|
13
13
|
end
|
14
14
|
end
|
@@ -6,10 +6,10 @@ module BridgeCache
|
|
6
6
|
joins(:live_course).merge(BridgeCache::LiveCourse.for_domain(domain_id))
|
7
7
|
end
|
8
8
|
|
9
|
-
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name:
|
10
|
-
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name:
|
11
|
-
belongs_to :live_course, foreign_key: :live_course_id, primary_key: BridgeCache.primary_key, class_name:
|
12
|
-
has_many :live_course_session_registrations, foreign_key: :live_course_session_id, primary_key: BridgeCache.primary_key, class_name:
|
9
|
+
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
10
|
+
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
11
|
+
belongs_to :live_course, foreign_key: :live_course_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourse.name, optional: true
|
12
|
+
has_many :live_course_session_registrations, foreign_key: :live_course_session_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourseSessionRegistration.name
|
13
13
|
|
14
14
|
end
|
15
15
|
end
|
@@ -6,10 +6,10 @@ module BridgeCache
|
|
6
6
|
joins(:live_course_enrollment).merge(BridgeCache::LiveCourseEnrollment.for_domain(domain_id))
|
7
7
|
end
|
8
8
|
|
9
|
-
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
10
|
-
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name:
|
11
|
-
belongs_to :live_course_enrollment, primary_key: BridgeCache.primary_key, class_name:
|
12
|
-
belongs_to :live_course_session, primary_key: BridgeCache.primary_key, class_name:
|
9
|
+
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
10
|
+
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
11
|
+
belongs_to :live_course_enrollment, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourseEnrollment.name, optional: true
|
12
|
+
belongs_to :live_course_session, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourseSession.name, optional: true
|
13
13
|
|
14
14
|
end
|
15
15
|
end
|
@@ -2,8 +2,8 @@ module BridgeCache
|
|
2
2
|
class Membership < ApplicationRecord
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
belongs_to :group, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name:
|
6
|
-
belongs_to :user, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name:
|
5
|
+
belongs_to :group, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Group.name, optional: true
|
6
|
+
belongs_to :user, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
7
7
|
|
8
8
|
def self.for_domain(domain_id)
|
9
9
|
joins(:group).where(bridge_cache_groups: {domain_id: domain_id})
|
@@ -2,12 +2,12 @@ module BridgeCache
|
|
2
2
|
class Program < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name:
|
6
|
-
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name:
|
7
|
-
has_many :program_items, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name:
|
8
|
-
has_many :program_enrollments, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name:
|
9
|
-
has_many :program_group_enrollments, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name:
|
10
|
-
has_many :affiliated_sub_accounts, primary_key: BridgeCache.primary_key, class_name:
|
5
|
+
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
6
|
+
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
7
|
+
has_many :program_items, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::ProgramItem.name
|
8
|
+
has_many :program_enrollments, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::ProgramEnrollment.name
|
9
|
+
has_many :program_group_enrollments, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::ProgramGroupEnrollment.name
|
10
|
+
has_many :affiliated_sub_accounts, primary_key: BridgeCache.primary_key, class_name: BridgeCache::AffiliatedSubAccount.name, as: :item
|
11
11
|
has_many :domains, through: :affiliated_sub_accounts
|
12
12
|
|
13
13
|
def self.for_domain(domain_id)
|
@@ -2,8 +2,8 @@ module BridgeCache
|
|
2
2
|
class ProgramEnrollment < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
6
|
-
belongs_to :program, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name:
|
5
|
+
belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
6
|
+
belongs_to :program, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Program.name, optional: true
|
7
7
|
|
8
8
|
def self.for_domain(domain_id)
|
9
9
|
joins(:program).merge(BridgeCache::Program.for_domain(domain_id))
|
@@ -2,8 +2,8 @@ module BridgeCache
|
|
2
2
|
class ProgramGroupEnrollment < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
belongs_to :group, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name:
|
6
|
-
belongs_to :program, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name:
|
5
|
+
belongs_to :group, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Group.name, optional: true
|
6
|
+
belongs_to :program, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Program.name, optional: true
|
7
7
|
|
8
8
|
end
|
9
9
|
end
|
@@ -2,7 +2,7 @@ module BridgeCache
|
|
2
2
|
class ProgramItem < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
belongs_to :program, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name:
|
5
|
+
belongs_to :program, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Program.name, optional: true
|
6
6
|
|
7
7
|
def self.for_domain(domain_id)
|
8
8
|
joins(:program).merge(BridgeCache::Program.for_domain(domain_id))
|
@@ -2,7 +2,7 @@ module BridgeCache
|
|
2
2
|
class Tag < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
has_many :taggings, foreign_key: :tag_id, primary_key: BridgeCache.primary_key, class_name:
|
5
|
+
has_many :taggings, foreign_key: :tag_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Tagging.name
|
6
6
|
|
7
7
|
end
|
8
8
|
end
|
@@ -2,8 +2,8 @@ module BridgeCache
|
|
2
2
|
class Tagging < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
belongs_to :tag, foreign_key: :tag_id, primary_key: BridgeCache.primary_key, class_name:
|
6
|
-
belongs_to :user, foreign_key: :tagger_id, primary_key: BridgeCache.primary_key, class_name:
|
5
|
+
belongs_to :tag, foreign_key: :tag_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Tag.name, optional: true
|
6
|
+
belongs_to :user, foreign_key: :tagger_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
|
7
7
|
|
8
8
|
def self.cleanup(current_row_ids)
|
9
9
|
BridgeCache::Tagging.where.not(bridge_id: current_row_ids).destroy_all
|
@@ -2,18 +2,18 @@ module BridgeCache
|
|
2
2
|
class User < BridgeBaseModel
|
3
3
|
extend BridgeCache::Data::BridgeModel
|
4
4
|
|
5
|
-
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name:
|
6
|
-
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name:
|
7
|
-
has_many :enrollments, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
8
|
-
has_many :course_templates, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
9
|
-
has_many :taggings, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
10
|
-
has_many :grants, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
11
|
-
has_many :groups, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
12
|
-
has_many :program_enrollments, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
13
|
-
has_many :memberships, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
14
|
-
has_many :learner_custom_field_values, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
15
|
-
has_many :live_course_enrollments, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
16
|
-
has_many :live_course_session_registrations, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name:
|
5
|
+
belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
6
|
+
belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
|
7
|
+
has_many :enrollments, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Enrollment.name
|
8
|
+
has_many :course_templates, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::CourseTemplate.name
|
9
|
+
has_many :taggings, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Tagging.name
|
10
|
+
has_many :grants, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Grant.name
|
11
|
+
has_many :groups, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Group.name
|
12
|
+
has_many :program_enrollments, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::ProgramEnrollment.name
|
13
|
+
has_many :memberships, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Membership.name
|
14
|
+
has_many :learner_custom_field_values, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LearnerCustomFieldValue.name
|
15
|
+
has_many :live_course_enrollments, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourseEnrollment.name
|
16
|
+
has_many :live_course_session_registrations, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourseSessionRegistration.name
|
17
17
|
|
18
18
|
serialize :config
|
19
19
|
|
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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jshaffer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -279,4 +279,3 @@ signing_key:
|
|
279
279
|
specification_version: 4
|
280
280
|
summary: A mountable engine for bridge data storage
|
281
281
|
test_files: []
|
282
|
-
has_rdoc:
|