incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niket Patel <nex...@me.com>
Subject Re: RelaxDB released
Date Mon, 25 Aug 2008 20:50:45 GMT
Thanks Paul,

Just looked at documentation not code. but,
Looks promising, specially uploading views using convention.

I will try to use this in current project.

On Aug 26, 2008, at 1:52 AM, Paul Carey wrote:

> 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) }


Mime
View raw message