matthewrudy / classy_tee

Class Table Inheritance for ActiveRecord and Rails

matthewrudy (author)
Sun Dec 07 09:20:49 -0800 2008
commit  8bf4d41026c2a98e6ed55d7d03566849e11d88d1
tree    508301d430159b397364a81802822b961f71c103
parent  ced7100eb990d6cd7e74c8cc2d4a11fc23fc08b5
classy_tee / README
100644 27 lines (18 sloc) 0.676 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
ClassyTee
=========
 
Classy Tee bring Class Table Inheritance to ActiveRecord and Rails in as simple a way possible.
 
Example
=======
 
if you have an existing model
  class Content < ActiveRecord::Base
  end
 
and you want to extend it.
Maybe you want to add a subclass that encapsulates all the logic of an MP3
 
  class MP3Content < ActiveRecord::Base
    classy_tee!
  end
 
this will look for a MP3ContentExtensions class,
and add all of its columns as though they were on the :content table.
 
Generate this automatically
 
  ruby script/generate classy_tee MP3Content mp3_url:string mp3_length:integer
 
Copyright (c) 2008 [Matthew Rudy Jacobs], released under the MIT license