Doing the simple stuff so you don't have to
Find a file
2010-06-16 12:40:56 +02:00
examples/model Moving to own repo without the base couchrest 2010-05-10 21:19:24 +02:00
lib Adding json to active_support 2010-06-16 12:40:56 +02:00
spec trying to refine design doc change detection 2010-06-15 02:10:14 +02:00
utils s/localhost/127.0.0.1/ 2008-12-14 12:05:02 +01:00
.gitignore Moving to own repo without the base couchrest 2010-05-10 21:19:24 +02:00
history.txt updating history 2010-06-15 01:26:23 +02:00
init.rb Moving to own repo without the base couchrest 2010-05-10 21:19:24 +02:00
LICENSE added apache license 2008-09-11 21:31:59 -07:00
Rakefile Doc and lib control alterations 2010-06-16 12:40:00 +02:00
README.md Doc and lib control alterations 2010-06-16 12:40:00 +02:00
THANKS.md fix repository url 2010-01-13 21:25:17 -02:00

CouchRest::ExtendedDocument: CouchDB, not too close to the metal

CouchRest::ExtendedDocument adds additional functionality to the standard CouchRest Document class such as setting properties, callbacks, typecasting, and validations.

Note: CouchRest::ExtendedDocument only supports CouchDB 0.10.0 or newer.

Install

$ sudo gem install couchrest_extended_document

Usage

General

require 'couchrest_extended_document'

class Cat < CouchRest::ExtendedDocument

  property :name,      String
  property :lives,     Integer, :default => 9

  property :nicknames, [String]

  timestamps!

  view_by :name

end

Notable Issues

ExtendedDocument uses active_support for some of its internals. Ensure you have a stable active support gem installed or at least 3.0.0.beta4.

JSON gem versions 1.4.X are kown to cause problems with stack overflows and general badness. Version 1.2.4 appears to work fine.

Ruby on Rails

CouchRest::ExtendedDocument is compatible with rails and provides some ActiveRecord-like methods. You might also be interested in the CouchRest companion rails project: http://github.com/hpoydar/couchrest-rails

Rails 2.X

In your environment.rb file require the gem as follows:

Rails::Initializer.run do |config|
  ....
  config.gem "couchrest_extended_document"
  ....
end

Testing

The most complete documentation is the spec/ directory. To validate your CouchRest install, from the project root directory run rake, or autotest (requires RSpec and optionally ZenTest for autotest support).

Docs

API: http://rdoc.info/projects/couchrest/couchrest_extended_document

Check the wiki for documentation and examples http://wiki.github.com/couchrest/couchrest

Contact

Please post bugs, suggestions and patches to the bug tracker at http://github.com/couchrest/couchrest/issues.

Follow us on Twitter: http://twitter.com/couchrest

Also, check http://twitter.com/#search?q=%23couchrest