File: loader.rb

package info (click to toggle)
ruby-foreigner 1.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 212 kB
  • ctags: 127
  • sloc: ruby: 720; makefile: 3
file content (20 lines) | stat: -rw-r--r-- 541 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Foreigner
  def self.load
    ActiveRecord::ConnectionAdapters.module_eval do
      include Foreigner::ConnectionAdapters::SchemaStatements
      include Foreigner::ConnectionAdapters::SchemaDefinitions
    end

    ActiveRecord::SchemaDumper.class_eval do
      include Foreigner::SchemaDumper
    end

    if defined?(ActiveRecord::Migration::CommandRecorder)
      ActiveRecord::Migration::CommandRecorder.class_eval do
        include Foreigner::Migration::CommandRecorder
      end
    end

    Foreigner::Adapter.load!
  end
end