module ActiveRecord::MTI

Multi-Table Inheritance

Active Record Schema Dumper

This class is used to dump the database schema for some connection to some output format (i.e., ActiveRecord::Schema).

Constants

VERSION

Attributes

logger[W]

Public Class Methods

load() click to toggle source
# File lib/active_record/mti.rb, line 42
def self.load
  ::ActiveRecord::Base.send                                  :prepend, ModelSchema
  ::ActiveRecord::Base.send                                  :prepend, Inheritance
  ::ActiveRecord::Relation.send                              :prepend, QueryMethods
  ::ActiveRecord::Relation.send                              :prepend, Calculations
  ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send :prepend, ConnectionAdapters::PostgreSQL::Adapter
  ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send :prepend, ConnectionAdapters::PostgreSQL::SchemaStatements
  ::ActiveRecord::SchemaDumper.send                          :prepend, SchemaDumper
end
logger() click to toggle source
# File lib/active_record/mti.rb, line 30
def logger
  @logger ||= Logger.new($stdout).tap do |log|
    log.progname = self.name
    log.level = Logger::INFO
  end
end
root() click to toggle source
# File lib/active_record/mti.rb, line 38
def self.root
  @root ||= Pathname.new(File.expand_path('../../', File.dirname(__FILE__)))
end
testify(value) click to toggle source
# File lib/active_record/mti.rb, line 52
def self.testify(value)
  value == true || value == 't' || value == 1 || value == '1'
end

Private Class Methods

find_oid_class() click to toggle source
# File lib/active_record/mti.rb, line 67
def self.find_oid_class
  oid_class_candidates.find(nil) { |klass|
    begin
      klass.constantize
      true
    rescue NameError
      false
    end
  }.constantize
end