# File lib/couchrest/model/designs.rb, line 45 def design(*args, &block) opts = prepare_design_options(*args) # Store ourselves a copy of this design spec incase any other model inherits. (@_design_blocks ||= [ ]) << {:args => args, :block => block} mapper = DesignMapper.new(self, opts[:prefix]) mapper.instance_eval(&block) if block_given? # Create an 'all' view if no prefix and one has not been defined already mapper.view(:all) if opts[:prefix].nil? and !mapper.design_doc.has_view?(:all) end