Displaying 1 result from an estimated 1 matches for "t4_id".
Did you mean:
  t1_id
  
2006 Apr 05
0
Fancy MySQL footwork
...-------+-------+
| id | t2_id | t3_id |
+----+-------+-------+
|  1 |     1 |  null |
|  2 |  null |     1 |
|  3 |  null |     2 |
+----+-------+-------+
select * from t2;
+----+-------+
| id | title |
+----+-------+
|  1 | "hat" |
+----+-------+
select * from t3;
+----+-------+
| id | t4_id |
+----+-------+
|  1 |     1 |
|  2 |     2 |
|  3 |     1 |
|  4 |     1 |
|  5 |     2 |
+----+-------+
select * from t4;
+----+-------+
| id | title |
+----+-------+
|  1 | "cat" |
|  2 | "rat" |
+----+-------+
with corresponding Rails models:
t1
  belongs_to :t2
  belo...