Commit graph

12 commits

Author SHA1 Message Date
Brian Candler ec7848b783 Multiple database support for ExtendedDocument.
New optional parameters are available to select the database:

Mixins::DocumentQueries
  * get <id>, <db>
  * all :database => <db>
  * first :database => <db>

Mixins::Views
  * view <name>, :database => <db>
  * all_design_doc_versions <db>
  * cleanup_design_docs! <db>

Mixins::DesignDoc
  * refresh_design_doc now only updates the design_doc _id and removes _rev
  * call save_design_doc to save and update the design_doc
  * call save_design_doc_on <db> to save the design doc on a given
    database without modifying the model's design_doc object

Design (core/design.rb)
  * new method view_on <db>, ...

Bug fixes:
  * design_doc_slug in mixins/design_doc.rb was using an empty document
    to calculate the slug each time
  * method_missing in core/extended_document.rb now passes a block through
2009-03-27 11:27:37 +00:00
Brian Candler f9278a4ca6 Typo in comment 2009-03-26 21:39:36 +00:00
Brian Candler ada5b1660f Move design_doc attributes to Mixins::DesignDoc 2009-03-26 21:21:20 +00:00
Geoff Buesing a1a4985149 Namespace Extlib versions of class_inheritable_accessor methods with extlib_prefix, as done in Wycats' Rails fork, so that their inclusion won't overwrite existing ActiveSupport implementations, if present. Check for existence of Class extensions on a per-method basis. 2009-03-19 16:59:22 -07:00
Matt Aimonetti 3e6dba7b66 fixed a bug with ExtendedDocument not declaring any views and trying to use #all or #first 2009-03-03 16:57:59 -08:00
Matt Aimonetti 7455152f63 fixed a typo in the previous commit 2009-03-02 22:36:57 -08:00
Matt Aimonetti 5258a0ba52 fixed a bug where :include_docs on a view couldn't be overwritten 2009-03-02 21:21:59 -08:00
Matt Aimonetti c4cce18389 added database.bulk_delete as an alias for #bulk_save, added support for Model.by_view_name in ExtendedDoc and bumped the version to 0.13.3 2009-02-17 00:36:11 -08:00
Matt Aimonetti 890b60cae4 added autovalidation (auto_validate! in your ExtendedDocument) and extracted some extlib stuff so we will soon be able to remove the dependency. 2009-02-05 17:06:12 -08:00
Matt Aimonetti dfdcd79a58 Started added a validation mixin
Usage:
  class Invoice < CouchRest::ExtendedDocument
    include CouchRest::Validation

    property :client_name
    property :employee_name
    property :location

    # Validation
    validates_present :client_name, :employee_name
    validates_present :location, :message => "Hey stupid!, you forgot the location"

  end
2009-02-02 19:21:32 -08:00
Matt Aimonetti 08c7f2107c moved stuff around and cleaned up some deprecation notices [save/save_doc] 2009-02-02 16:10:07 -08:00
Matt Aimonetti 6b2e5f84ad Started the refactoring work on couchrest.
* A server can have multiple defined available databases set to be used by documents (think DM repos)
* A server can have a default database so documents can easily share the same db connection
* Let a document class have a default database to use
* Give access to a document uri
* extracted some of the document features to a mixin
2009-01-28 22:55:42 -08:00