Skip to content
This repository has been archived by the owner. It is now read-only.
Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
app
 
 
 
 
lib
 
 
log
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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

Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •  
You can’t perform that action at this time.