lib/couchrest/mixins/design_doc.rb in jchris-couchrest-0.16 vs lib/couchrest/mixins/design_doc.rb in jchris-couchrest-0.17.0
- old
+ new
@@ -14,9 +14,10 @@
end
def design_doc_slug
return design_doc_slug_cache if (design_doc_slug_cache && design_doc_fresh)
funcs = []
+ design_doc ||= Design.new(default_design_doc)
design_doc['views'].each do |name, view|
funcs << "#{name}/#{view['map']}#{view['reduce']}"
end
md5 = Digest::MD5.hexdigest(funcs.sort.join(''))
self.design_doc_slug_cache = "#{self.to_s}-#{md5}"
\ No newline at end of file