Module: ActiveRecord

Defined in:
lib/rmtools/active_record/base.rb,
lib/rmtools/active_record/declarative.rb

Defined Under Namespace

Modules: ConnectionAdapters Classes: Base, Relation

Class Method Summary collapse

Class Method Details

.establish_connection_with(config) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rmtools/active_record/base.rb', line 4

def self.establish_connection_with config
  c = case config
          when String
            c = if config.inline
                    if c = RMTools.read(config) then c
                    else return; nil
                    end
                  else config
                  end
            YAML.load c
          when IO then YAML.load config
          else config
        end
  Base.establish_connection(c) rescue(false)
end