fixed a major bug with inheritance and the class database setup. (plus some validation bugs)

This commit is contained in:
Matt Aimonetti 2009-02-10 16:10:35 -08:00
parent e448112ff6
commit c0abafd1e0
6 changed files with 16 additions and 24 deletions

View file

@ -4,18 +4,18 @@ module CouchRest
class Document < Response
include CouchRest::Mixins::Attachments
# def self.inherited(subklass)
# subklass.send(:class_inheritable_accessor, :database)
# end
class_inheritable_accessor :database
attr_accessor :database
@@database = nil
# override the CouchRest::Model-wide default_database
# This is not a thread safe operation, do not change the model
# database at runtime.
def self.use_database(db)
@@database = db
end
def self.database
@@database
self.database = db
end
def id