Multi-Table Inheritance in Rails - When two tables are one...
March 13th, 2008
I had a situation where I had two tables, one was read only data and the other was where I would put my new data. They both modeled the same object (a person) but I had to figure out how to have ONE object for the system to interact with.
That is, how do you make two tables into one model in Rails?
MULTI-TABLE INHERITANCE!!!!!
Read the rest of this entryPlease, think of your server!
November 26th, 2007
This is the first blog entry of the RSPCS… the Royal Society of the Performance and Care of Servers… our first target, people’s abuse of the use of ActiveRecord’s “find” class method.
Read the rest of this entryLatest comments
- Tomek
CTR-W is my best friend :) So called bash shotcuts – highly recommended stuff
- Ali Rizvi
Did you mean Person.new instead of MyStruct.new in your second code excerpt?
Keep up the good work! Ali
- Mikel
@Clemens
I actually use Geoffrey’s approach in all my spec’s in addition to this little builder.
The idea of the...
- Clemens Kofler
Geoffrey Grosenbach uses another method in his screencasts sometimes.
In your user_spec.rb, you’d have the following code:module UserSpecHelper...
- Xavier Shay
Even quicker way to assign User.find to a variable: user = _
the value of the last line executed is...
- Mikel
Duncan, good point, I changed the code above. Thanks for that.