Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Object Document Mapper for Rails 3 that implements ActiveModel

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README
CouchRails is a Object Document Mapper for CouchDB that implements the new Rails 3 ActiveModel.
It uses CouchRest.

Here are what it does right now:

CouchRails::Config
- should create a db based on model_name the model is not on the map
- should use the provided name

An active_model compliant CouchRails::ActiveModel
- must implement the #to_key interface
- must implement the #to_param interface
- must implement the #valid? interface
- must implement the #persisted? interface
- must implement the #model_naming interface
- must implement the #errors interface

An active_model compliant CouchRails::ActiveModel persisted?
- should be persisted after saved
- should not be persisted when created

An active_model compliant CouchRails::ActiveModel to_key
- should return the _id as key for persisted document
- should return nil as the key for new document
- should allow user specify which field will be the key
- should return nil when the object is new, even when there is a field specified as the key

An active_model compliant CouchRails::ActiveModel to_param
- should resolve to the first item of to_key result when the document is persisted
- should resolve to nil when the document is new

An active_model compliant CouchRails::ActiveModel initialization
- should set a database with a default name on the initialization
- should initialize a model with the correct db name from config


This project is under MIT License
Something went wrong with that request. Please try again.