lib/couchrest/railtie.rb in couchrest_model-1.1.0.beta4 vs lib/couchrest/railtie.rb in couchrest_model-1.1.0.beta5

- old
+ new

@@ -1,12 +1,21 @@ require "rails" require "active_model/railtie" -module CouchrestModel +module CouchRest # = Active Record Railtie - class Railtie < Rails::Railtie + class ModelRailtie < Rails::Railtie config.generators.orm :couchrest_model config.generators.test_framework :test_unit, :fixture => false + + initializer "couchrest_model.configure_default_connection" do + CouchRest::Model::Base.configure do |conf| + conf.environment = Rails.env + conf.connection_config_file = File.join(Rails.root, 'config', 'couchdb.yml') + conf.connection[:prefix] = + Rails.application.class.to_s.underscore.gsub(/\/.*/, '') + end + end end - + end - +