Sha256: 015c3a0655ccca72d48eb9ccbd996854d10deb1863055f6d4ee36a86b50c2e53

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

# Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
# License:   Apache License, Version 2.0

require 'rtm/activerecord/rdbms_config'
require 'rtm/activerecord/001_initial_schema'
require "rtm/activerecord/io/from_xtm2"
# require "rtm/backend/active_record/io/from_xtm2_libxml"

module RTM::AR
  module TopicMapSystem
    include RTM::TopicMapSystem
    include RTM::AR::RdbmsConfig

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

    def topic_maps
      TopicMap.topic_maps
    end

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

    # Assignes a logger to active record (or STDOUT as default) which outputs
    # the sql statements.
    def log(to=STDOUT)
      ActiveRecord::Base.logger = Logger.new(to)
      ActiveRecord::Base.colorize_logging = false if PLATFORM =~ /mswin|mingw/
    end

    # This function generates the database schema using the default
    # ActiveRecord connection.
    def migrate_database
      TMDM::InitialSchema.migrate(:up)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rtm-activerecord-0.3.1 lib/rtm/activerecord/topic_map_system.rb