On 19 March 2010 11:43, Tom Mac wrote:
> why everything is stored in a single table
That's called Single Table Inheritance (STI)
> Can we store each items for say staff,director etc to
> there own tables? Or Am I wrong?
You're not wrong; you can do it with different tables if you want.
Data m
Hi
Thanks for your reply. This I have already thought of. But one
thing I can't understand is why everything is stored in a single table
say users here? Can we store each items for say staff,director etc to
there own tables? Or Am I wrong?
Tom
--
Posted via http://www.ruby-forum.com/.
-
Let say
you are having staff, directors and managers as part of your system, and
their details will be in users table so let say we can build inheritance
based relationship like below:
Class User < ActiveRecord::Base
end
Class Staff < User
end
Class Director < User
end
Class Manager < User
3 matches
Mail list logo