ruby-on-railsrubyfabrication-gem

In the fabrication gem what does the bang mean?


I'm using this gem - https://github.com/paulelliott/fabrication and I've inherited some specs that contain the following

Fabricator(:tenant_user) do user! tenant! end

For the life of me I can't find any documentation to detail what the bang is actually for... any ideas - or ideally a link to documentation?


Solution

  • Just got an answer from Paul who created the gem. Answering here as might be useful for anybody else.

    'That is an old syntax that was deprecated with version 2.0.0. If you are on a newer version than that you can safely remove them.

    If you're on an older version, those tell Fabrication to generate the model immediately instead of on 1st access. Without them it will wait until you actually call the field accessor to generate the associated model.'