Top Level Namespace

Defined Under Namespace

Modules: Reactive

Instance Method Summary collapse

Instance Method Details

#reactive_activerecord_initObject

Also called from the ModelGenerator



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/reactive-activerecord.rb', line 7

def reactive_activerecord_init # :nodoc:
  gem 'activerecord', Reactive.configuration.reactive_activerecord.gem_requirement || '>=0'
  require 'activerecord'
  
  (Reactive.configuration.reactive_activerecord.base || {}).each do |name, value|
    ActiveRecord::Base.send("#{name}=", value)
  end

  ActiveRecord::Base.logger ||= Reactive.logger
  ActiveRecord::Base.configurations = YAML::load(IO.read(Reactive.configuration.reactive_activerecord.config_file))
  ActiveRecord::Base.establish_connection(Reactive.configuration.environment)
end