# File lib/couchrest/model/persistence.rb, line 121 def build_from_database(doc = {}, options = {}, &block) src = doc[model_type_key] base = (src.blank? || src == model_type_value) ? self : src.constantize base.new(doc, options.merge(:directly_set_attributes => true), &block) end