From user-return-3382-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Mon Feb 09 02:21:42 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 43778 invoked from network); 9 Feb 2009 02:21:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2009 02:21:41 -0000 Received: (qmail 89275 invoked by uid 500); 9 Feb 2009 02:21:39 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 89233 invoked by uid 500); 9 Feb 2009 02:21:39 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 89220 invoked by uid 500); 9 Feb 2009 02:21:39 -0000 Delivered-To: apmail-incubator-couchdb-user@incubator.apache.org Received: (qmail 89214 invoked by uid 99); 9 Feb 2009 02:21:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Feb 2009 18:21:39 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paul@rushedsunlight.com designates 72.14.220.152 as permitted sender) Received: from [72.14.220.152] (HELO fg-out-1718.google.com) (72.14.220.152) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 02:21:30 +0000 Received: by fg-out-1718.google.com with SMTP id d23so986147fga.26 for ; Sun, 08 Feb 2009 18:21:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.227.10 with SMTP id e10mr1878979mur.30.1234146064910; Sun, 08 Feb 2009 18:21:04 -0800 (PST) Date: Mon, 9 Feb 2009 02:21:04 +0000 Message-ID: <78c6a6cc0902081821v2e2b8580o75aded862f722d04@mail.gmail.com> Subject: Stuffing: a Ruby on Rails plugin to add CouchDB to existing ActiveRecord models From: Paul Campbell To: couchdb-user@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I've been very quiet around these parts, but I've noticed that there are plenty of users on here that use Ruby/Rails. I've been working on some CMS stuff backed with CouchDB and decided to do some abstracting so that I could get my blog up and running off CouchDB. I thought you might be interested in this: http://www.pabcas.com/feeling/stuffing-couchdb-into-rails Basically, it's a plugin that lets you use CouchDB with existing (or new) ActiveRecord SQL models. You basically don't ever have to leave ActiveRecord or SQL, but you get a bonus attribute (your 'stuffing') that is a hash that persists to CouchDB. In brief, it's something like this: class Post < ActiveRecord::Base stuffing end @post = Post.new @post.stuffing => {} @post.stuffing_title = "Welcome to Stuffing" @post.stuffing => {:title => "Welcome to Stuffing"} @post.stuffing_title => "Welcome to Stuffing" It's pretty basic stuff, but it's a really quick win if you want to use CouchDB on top of existing ActiveRecord models, or if you want to use the schema-less nature of CouchDB for your documents, but use ActiveRecord finders, plugins and relationships. The plugin itself is on Github where there's more examples and options etc. http://github.com/paulca/stuffing/tree/master Let me know if you think this is useful, or if you have any questions about the motivations that led to writing this, Paul