Skip to content
This repository has been archived by the owner. It is now read-only.

rethinkdb/rails-nobrainer-blog

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

This is the Rails tutorial basic blog app ported to use NoBrainer ORM for RethinkDB.

Note: this sample app is still under development.

NoBrainer ORM for RethinkDB

In order to benefit of as much of the Rails-packaged goodies, we're using the NoBrainer ORM for RethinkDB.

Using NoBrainer instead of ActiveRecord is very easy:

class Post
  include NoBrainer::Document
  include NoBrainer::Document::Timestamps

  # Defines the fields of the document visible to the application
  field :author,  :type => String, :required => true
  field :title,   :type => String, :required => true
  field :content, :type => Text,   :min_length => 5

  # Defines a one-to-many relationship between +Post+ and +Comment+
  has_many :comments, :dependent => :destroy
end

See the two models defined by this sample app for more details: post.rb and comment.rb

Accessing the data

You can check out the two controllers posts_controller.rb and comments_controller.rb to see how using the model methods translates into RethinkDB's ReQL queries.

About

The Rails tutorial blog app using NoBrainer ODM for RethinkDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •