Build A Hash Of Model Attributes
> FactoryBot.build(:book).attributes
{ "id"=>nil, "title"=>"Fledgling", "genre"=>"fiction" }> FactoryBot.attributes_for(:book)
{ title: "Fledgling", genre: "fiction" }> FactoryBot.attributes_for(:book, :published)
{
title: "Fledgling",
genre: "fiction",
publication_year: 2005,
page_count: 362
}Last updated