Working on adding automated configuration support
This commit is contained in:
parent
37c021a6b9
commit
f3dd4ae06e
9 changed files with 299 additions and 26 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue