Enterprise Rails

11/09/2008

I recently picked up the book Enterprise Rails by Dan Chak.

it’s an excellent book, and was sorely needed by me. The biggest thing for me was that it explains how to use a good (i.e. PostgreSQL) database effectively and shows how to use materialized views, triggers, and so forth in a Rails application.

It also delves into how to organize a large Rails application, separating your models into modules and then into standalone services. Afaik, no other book shows how to do this sort of stuff.

We’re looking to apply it to this site. (note: not all the tests are counted, since “rake stats” only shows the specs, not the “historical” tests in the tests directory)

+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Libraries            |  1301 |  1003 |      24 |     168 |   7 |     3 |
| Models               |  6112 |  4927 |     110 |     757 |   6 |     4 |
| Helpers              |  1836 |  1575 |       0 |     176 |   0 |     6 |
| Controllers          |  4342 |  3696 |      90 |     478 |   5 |     5 |
| Model specs          |  2915 |  2417 |       2 |       9 |   4 |   266 |
| View specs           |   370 |   301 |       0 |       1 |   0 |   299 |
| Controller specs     |  1307 |  1043 |       0 |       4 |   0 |   258 |
| Helper specs         |   432 |   286 |       0 |       0 |   0 |     0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                | 18615 | 15248 |     226 |    1593 |   7 |     7 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 11201     Test LOC: 4047     Code to Test Ratio: 1:0.4

  1. Bob says:

    11/18/2008

    Hm, sounds like a good book. Thanks for the tip!