This blog has been archived. Our writing has moved to makandra cards.
The blog of , a Ruby on Rails development team

Callbacks for the Machinist

We like Machinist a lot. Unfortunately there are record construction rules cannot be expressed with a Machinist blueprint, for instance:

  • Creating a record with a has_many association already filled in.
  • Creating a record with interdependencies between associated objects, such as having to belong to the same container.
  • Needing to process a delayed_job queue after record construction.

We just released machinist_callbacks to fix that. This gem provides before_make and after_make callbacks, allowing you to write a blueprint like this:

Director.blueprint do
  name
  after_make { movies << Movie.make }
end

Check out machinist_callbacks on Github.

Growing Rails Applications in Practice
Check out our e-book:
Learn to structure large Ruby on Rails codebases with the tools you already know and love.

Recent posts

Our address:
makandra GmbH
Werner-von-Siemens-Str. 6
86159 Augsburg
Germany
Contact us:
+49 821 58866 180
info@makandra.de
Commercial register court:
Augsburg Municipal Court
Register number:
HRB 24202
Sales tax identification number:
DE243555898
Chief executive officers:
Henning Koch
Thomas Eisenbarth