Forum OpenACS Development: Re: Ruby on Rails Review Part I

Collapse
Posted by Andrei Popov on
I have not posted or taken part in OpenACS anything for a few years now, and I have been playing around with RoR a bit in the last few weeks -- here's my feeling: for an "easy" start it is much more like ACS 3.x with a few lessons learned.  The lessons are basically the same (or similar) to the ones implemented in OACS 4.x, but having more to learn from and using a different language as the basis of the toolkit -- result is different (and overall very nice).

One thing I find it does suffer from (not planning to start a flame war, no) is a bit of MySQL-ism here and there, yet it is not too ugly.  Examples: it is a pain to call up a function if you use Pg, references are deduced from column naming instead of explicit foreign key definition, I don't think (but I am too new to this to be sure) one can easily express a join of several (more than two) tables (although with Postgres to the rescue one can do a view with a rule that'd act on all the joins you want to put in)).

Collapse
Posted by Andrei Popov on

One more point -- rake migrations are great and ActiveRecord is pretty cool, but both work at a "lowest" denominator level. What this means is that you can have this defined in Postgres:

create table things (
  id integer not null primary key,
  some_text varchar(100)
    constraint things_some_text_un unique
);

create table gadgets ( id integer not null primary key, thing_id integer not null constraint gadgets_fk references things(id), status_code varchar(1) constraint gadgets_status_code_ck check (status_code in ('c','o')) default 'c' );

But all (well, most of) these wonderful constraints will not be re-created once you run rake migrate on another machine....