Skip to content
Tiny implmentation of ORM on top of Arel
Ruby Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
lib
test
.gitignore
.travis.yml
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
travis-setup

README.md

Torm Build Status

DESCRIPTION

Oh Really Magical, Tiny ORM

Does it work?

Yes. First create database:

psql
create database torm_development;
\c torm_development;
CREATE TABLE posts ( id integer primary key, name varchar(20), content text, author varchar(100), subject varchar(1000));

Now run tests:

bundle exec rake test

What can it do?

Check the model tests, to find complete list of operations.

Usage

class Post < Torm::Model
end

post = Post.new subject: 'What is RGenCG?'
post.save

first_post = Post.find(1)
puts first_post.subject
=> 'What is RGenCG?'

first_post.subject = 'What is RincCG?'
first_post.save
puts Post.find(1).subject
=> 'What is RincCG?'
  
Post.where(id: 1).subject
=> 'What is RincCG?'
   
Post.count
=> 1

Post.delete_all
Post.count
=> 0
You can’t perform that action at this time.