Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

flatfoot

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 data
Octocat-spinner-32 README
Octocat-spinner-32 demo.rb
Octocat-spinner-32 flatfoot.rb
Octocat-spinner-32 flatfoot_spec.rb
README
= Flatfoot

a flatfile based ORM

Uses flat files and YAML serialization to store data. Great for blogs and other simple things.
check it out by running

ruby demo.rb

class User < Flatfoot

  has_many :photos
  has_many :posts

  attributes :name, :hashed_password, :salt, :email

end

class Post < Flatfoot

  belongs_to :user
  attributes :title, :body

end

u = User.create(:name => "paul")
p = Post.create(:user => u)

Install

gem install activesupport
git clone git://github.com/paulmars/flatfoot.git
cd flatfoot

Try

ruby demo.rb
ls -lR data

Accessors:

AR styled. 

Finders:

User.all.select{|x| x.created_at > YOUR_TIME }

Callbacks:

before_save
after_save
before_create
after_create

Automatic Inclusion of
fn, created_at, updated_at attributes

fn is the shorthand for 'filename' which is the primary key.

currently uses a random_string of X characters for uniqueness, this is easily overidable by changeing "generate_fn" method.

Todo:
validations
before_valid, after_valid
valid?
Something went wrong with that request. Please try again.