When do I need to use build when creating new records

I can create a new record from the model on the right side of a has_many statement Why user the model on the left plus . plus the model on the right plus build The reason I’m asking is because I came across this piece of code below As you can see it’s a little primitive placing the seller’s name in the auction model instead of leaving it alone and rendering in views from the records in User I’m gonna remove seller_name from the table

@auction = current_user.auctions.build(params[:auction])

@auction.seller_name = current_user.name

The build method constructs the ORM object without validating or saving. It provides an opportunity to configure attributes before saving, before validating. If you feel good about the params[:auction], have them filtered with require and permit, and aren’t going to groom the record any further, then create or create! will serve. When using create it’s necessary to check the return value for failures. With create! you’ll have the ActiveRecord::RecordInvalid or other exception to capture on failure.