incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Carey" <>
Subject RelaxDB released
Date Mon, 25 Aug 2008 20:22:01 GMT
RelaxDB provides a(nother) Ruby interface to CouchDB. It takes its
inspiration from ActiveRecord and offers a simple idiom for specifying
object relationships. The underlying objects are persisted to CouchDB.
Combined with the schema free nature of CouchDB, RelaxDB's current
strength lies in quick prototyping of object models.

More details on github

A basic merb plugin, merb_relaxdb is also available on github.



class Post < RelaxDB::Document
  property :created_at
  property :contents

  belongs_to :writer
  has_many :ratings, :class => "Rating"

class Rating < RelaxDB::Document
  property :thumbs_up, :validator => lambda { |tu| tu < 3 }

  belongs_to :post
  belongs_to :critic

post.ratings << => gromit)
Rating.all.sorted_by(:thumbs_up) { |q| q.key(2).count(1) }

View raw message