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
http://github.com/paulcarey/relaxdb/wikis

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

Paul

====

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

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

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

  belongs_to :post
  belongs_to :critic
end

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

Reply via email to