Skip to content
notahat edited this page Aug 23, 2010 · 16 revisions

What’s New?

Machinist 2 gives you the convenience of Machinist, with the performance of fixtures.

When you create an object, Machinist 2 keeps the object around in the database. If, in a later test, you request an identical object, Machinist will give you the cached copy.

See the page on Object Caching for more information.

Other features:

- Simpler API and simpler implementation
- Better handling of has_many and has_and_belongs_to_many relationships

What’s Changed?

Machinist 2 is not a drop-in replacement for Machinist 1. Implementing caching has required substantial changes to the API.

- Sham has gone away.
- make has become make!, and make_unsaved has become make.
- You can no longer refer directly to other attributes when defining an attribute in a blueprint; use object instead.

Upgrading

- Replace calls to make with calls to make!, except within your blueprints.
- Replace calls to make_unsaved with calls to make.
- Delete all your Sham definitions, and provide explicit attribute values in all your blueprints. See Serial Numbers for information on handling unique attributes.

Clone this wiki locally