Monday 9 January 2006

Upgraded to Rails v1.0

Managed the upgrade to version 1 without any major hitches. Just two notable differences...

  • The AJAX stuff is fixed (which stopped us from upgrading to the last release).
  • ActiveRecord has slightly stricter constraints on creation of new objects with has_and_belongs_to_many relationships.

The ActiveRecord change means that you can't create a new object and it's join table based relationships without first saving the main object. If object has_and_belongs_to_many relations, then... object = object.relations << relation needed changing to... object = Object.create object.relations << relation

It makes some sense, since the identity of object has not yet been created, but it's a bit of a shame that the ORM layer can't hide these issues from you.

No comments:

Post a Comment