lib/couchrest/model/design_doc.rb in couchrest_model-1.0.0.beta8 vs lib/couchrest/model/design_doc.rb in couchrest_model-1.0.0

- old
+ new

@@ -1,14 +1,11 @@ # encoding: utf-8 module CouchRest module Model module DesignDoc + extend ActiveSupport::Concern - def self.included(base) - base.extend(ClassMethods) - end - module ClassMethods def design_doc @design_doc ||= Design.new(default_design_doc) end @@ -32,10 +29,10 @@ "_id" => design_doc_id, "language" => "javascript", "views" => { 'all' => { 'map' => "function(doc) { - if (doc['couchrest-type'] == '#{self.to_s}') { + if (doc['#{self.model_type_key}'] == '#{self.to_s}') { emit(doc['_id'],1); } }" } }