Sha256: 959991ce8a700e0cc5c5445aeba753ded4f3d2851abafdd5a21626fa17b39ad0

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

Recliner is a Ruby ORM for interfacing with CouchDB (http://couchdb.apache.org/) databases.

It is designed to be familiar to users of ActiveRecord, but diverges where necessary to fit with the CouchDB document/view paradigm.


Example
=======

class Article < Recliner::Document
  property :title, String, :default => 'Untitled'
  property :body, String
  property :published_at, DateTime
  property :approved, Boolean, :default => false
  timestamps!
  
  attr_protected :published_at, :approved
  
  belongs_to :author, :class_name => 'User'
  
  default_order :published_at
  
  view :by_title, :order => :title
  view :approved, :conditions => { :approved => true }
  
  validates_presence_of :title, :body
  
  before_save :set_published_at
end


article1 = Article.create(:title => "Recliner wins multiple awards!",
                          :body => "Actually, it hasn't happened yet",
                          :approved => true)
article2 = Article.create(:title => "Recliner 1.0 released",
                          :body => "Yes, it's true!",
                          :approved => false)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
recliner-0.0.1 README