ruby - ActiveRecord in Rails 4 without environment specific databases -
i want know if there way of using activerecord without environment specific databases (development, test, production).
the reason using mongodb main database (mongoid), need access external oracle database , use active record.
the problem when enable active record in application.rb:
require 'active_record/railtie'
it tries connect development database (which won't exist).
is there way around this? thanks
try requiring active record, this:
require "active_record"
and load database.yml
file manually this:
activerecord::base.configurations = yaml.load_file(file.expand_path('../database.yml', __file__))
then can remove development, test , production databases database.yml
.
Comments
Post a Comment