Class: BridgeCache::BridgeBaseModel
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- BridgeCache::BridgeBaseModel
show all
- Defined in:
- app/models/bridge_cache/bridge_base_model.rb
Direct Known Subclasses
AffiliatedSubAccount, ApplicationRecord, CourseTemplate, CustomField, Domain, Enrollment, EnrollmentProfile, Grant, Group, Host, LiveCourse, LiveCourseEnrollment, LiveCourseSession, LiveCourseSessionRegistration, Program, ProgramEnrollment, ProgramGroupEnrollment, ProgramItem, Tag, Tagging, User, UserCourseVisit
Constant Summary
collapse
- BRIDGE_ID =
'bridge_id'.freeze
- OWNER_ID =
'owner_id'.freeze
- PARENT_ID =
'parent_id'.freeze
- DOMAIN_ID =
'domain_id'.freeze
Instance Method Summary
collapse
Instance Method Details
#adjusted_table_name ⇒ Object
18
19
20
21
22
23
24
|
# File 'app/models/bridge_cache/bridge_base_model.rb', line 18
def adjusted_table_name
if BridgeCache.use_internal_database
table_name
else
to_s.demodulize.underscore.pluralize
end
end
|
#bridge_id ⇒ Object
10
11
12
13
14
15
16
|
# File 'app/models/bridge_cache/bridge_base_model.rb', line 10
def bridge_id
if self.class.column_names.include? BRIDGE_ID
self[:bridge_id]
else
id
end
end
|