Commit graph

26 commits

Author SHA1 Message Date
Marcos Tapajós
228783d453 Removing duplicated code 2010-02-27 19:23:02 -03:00
Peter Gumeson
6d571a7d81 Class proxy was not setting database on result sets 2010-02-27 18:42:32 -03:00
John Wood
4a8015b119 Move the provides_collection declaration into the Article test fixture, and out of the test, fixing a test case that was failing in ruby 1.9.
Signed-off-by: Will Leinweber <will@bitfission.com>
2010-01-07 12:25:31 -06:00
John Wood
feb09f9764 Removed amount_pages calculation for the pagination collection, since it cannot be reliably calculated without a view 2009-08-20 12:29:02 -07:00
John Wood
b0dca70b02 Fixed a bug in the pagination code that caused it to paginate over records outside of the scope of the view parameters. 2009-08-20 12:28:28 -07:00
Matt Aimonetti
889a923dbf Added #amount_pages to a paginated result array 2009-08-03 12:19:07 -07:00
Matt Aimonetti
a17df45fc3 made all the specs run on 1.9.2, yay :) 2009-08-01 14:21:18 -07:00
Matt Aimonetti
5cd2eaf18a made get not raise an exception anymore, use get! instead if you need to raise exceptions.
* ExtendedDocument.get doesn't raise an exception anymore. If no documents are found nil is returned.
* ExtendedDocument.get! works the say #get used to work and will raise an exception if a document isn't found.
2009-07-22 16:05:55 -07:00
Daniel Kirsch
4d4972f0de fixed class proxy design doc wreidness 2009-07-21 23:38:00 +02:00
Daniel Kirsch
be7cd7442b added count to proxy 2009-07-21 14:14:58 +02:00
Matt Aimonetti
413a7602e8 added amount_pages to a paginated collection 2009-07-20 15:52:14 -07:00
Matt Aimonetti
9a167cc27d fixed the specs 2009-07-14 23:48:06 -07:00
John Wood
a0d6204b42 Added some more doc for Collection, and cleaned up how provides_collection works. 2009-07-08 09:43:31 -07:00
John Wood
a9a53b8729 Added more tests for Collection module, cleaned up the code as well. 2009-07-08 09:40:47 -07:00
John Wood
5963f1d4f8 Better integration with couchrest views. More tests, doc, and some cleanup still needed. 2009-07-08 09:39:30 -07:00
Matt Aimonetti
295c0f0511 fixed the design doc cache issue 2009-05-27 23:59:43 -07:00
Matt Aimonetti
c35c35157a added an automated way to mark design docs as dirty after the db was reset 2009-05-27 18:16:50 -07:00
Matt Aimonetti
e48a6c8866 fixed all the specs so we are back to green 2009-05-26 18:27:49 -07:00
Matt Aimonetti
2d52225a25 fixed some stuff but a lot of specs are still failing on 409s 2009-05-26 16:28:34 -07:00
Matt Aimonetti
b89d327a61 cleaned up the design view names since we don't need to use md5 view names anymore. (we are using different revision numbers) 2009-05-17 19:34:02 -07:00
Brian Candler
c4b49baecf ClassProxy provides class-level methods on a dynamically chosen database.
Examples:

  db = CouchRest::Database.new(...)
  articles = Article.on(db)

  articles.all { ... }
  articles.by_title { ... }

  u = articles.get("someid")

  u = articles.new(:title => "I like plankton")
  u.save    # saved on the correct database
2009-03-27 13:42:49 +00:00
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
Matt
2aeb90721e corrected some spec dependencies 2009-03-08 14:27:30 +00:00
Matt Aimonetti
5607936540 updated the callback system using Yehuda's latest version and bumped the release to make the latest fixes available 2009-03-05 23:52:48 -08:00
Matt Aimonetti
7455152f63 fixed a typo in the previous commit 2009-03-02 22:36:57 -08:00
Matt Aimonetti
fe489f2d38 removed CouchRest::Model, added more specs and fixed a bug with casted CR::ExtendedDocument 2009-02-24 22:51:13 -08:00