BUGFIX: attribute protection

Fixes bug where documents recreated from the database were
being stripped of their protected attributes when instantiated

Signed-off-by: Marcos Tapajos <tapajos@Tapajos-MacBook.local>
This commit is contained in:
Will Leinweber 2009-12-04 01:58:07 -06:00
parent 5707d89290
commit d41c7c96da
5 changed files with 84 additions and 17 deletions

View file

@ -51,11 +51,9 @@ module CouchRest
# db<Database>:: optional option to pass a custom database to use
def get(id, db = database)
begin
doc = db.get id
get!(id, db)
rescue
nil
else
new(doc)
end
end
@ -72,11 +70,11 @@ module CouchRest
# db<Database>:: optional option to pass a custom database to use
def get!(id, db = database)
doc = db.get id
new(doc)
create_from_database(doc)
end
end
end
end
end
end