Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

The Rails tutorial blog app using NoBrainer ODM for RethinkDB

Notifications You must be signed in to change notification settings

rethinkdb/rails-nobrainer-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  •  
  •  
  •  
  •