Working on adding automated configuration support

This commit is contained in:
Sam Lown 2011-04-29 21:40:36 +02:00
parent 37c021a6b9
commit f3dd4ae06e
9 changed files with 299 additions and 26 deletions

View file

@ -89,10 +89,6 @@ module CouchRest
self
end
def database
self.class.database(@database)
end
protected
def perform_validations(options = {})
@ -108,20 +104,6 @@ module CouchRest
module ClassMethods
# Replace CouchRest's database reader with a more advanced
# version that will make a best guess at the database you might
# want to use. Allows for a string to be provided instead of
# a database object.
def database(db = nil)
db ||= @database
if db.nil?
# try to grab from configuration files
else
db
end
end
# Creates a new instance, bypassing attribute protection
#
# ==== Returns