Class: BridgeCache::BridgeBaseModel

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/bridge_cache/bridge_base_model.rb

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_nameObject



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_idObject



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