Module: RTM::AR::TopicMapSystem

Includes:
RdbmsConfig, TopicMapSystem
Included in:
ActiveRecord
Defined in:
lib/rtm/activerecord/topic_map_system.rb

Instance Method Summary collapse

Methods included from RdbmsConfig

#connect, #connected?

Instance Method Details

#[](*args) ⇒ Object



22
23
24
25
26
27
# File 'lib/rtm/activerecord/topic_map_system.rb', line 22

def [](*args)
  if args.size == 0
    return TopicMap.topic_maps
  end
  TopicMap.topic_maps[*args]
end

#create(base_locator) ⇒ Object



14
15
16
# File 'lib/rtm/activerecord/topic_map_system.rb', line 14

def create(base_locator)
  TopicMap.create(base_locator)
end

#log(to = STDOUT) ⇒ Object

Assignes a logger to active record (or STDOUT as default) which outputs the sql statements.



31
32
33
34
# File 'lib/rtm/activerecord/topic_map_system.rb', line 31

def log(to=STDOUT)
  ActiveRecord::Base.logger = Logger.new(to)
  ActiveRecord::Base.colorize_logging = false if PLATFORM =~ /mswin|mingw/
end

#migrate_databaseObject

This function generates the database schema using the default ActiveRecord connection.



38
39
40
# File 'lib/rtm/activerecord/topic_map_system.rb', line 38

def migrate_database
  TMDM::InitialSchema.migrate(:up)
end

#topic_mapsObject



18
19
20
# File 'lib/rtm/activerecord/topic_map_system.rb', line 18

def topic_maps
  TopicMap.topic_maps
end