Skip to content

tmaeda/auto_ar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This gem makes subclasses of ActiveRecord::Base and
sets associations(has_many, belongs_to) to the class on demand.

  require 'rubygems'
  require 'active_record'
  require 'auto_ar'

  ActiveRecord::Base.establish_connection(:adapter => 'sqlite3',
                                          :database => 'foo.sqlite3')

  blogs = Blog.find(:all) # <= You can use Blog class without blog.rb
  comments = blog[0].comments # <= You can get Comment class instances without comment.rb

About

A gem that makes ActiveRecord subclasses on the fly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages