By default, FactoryBot assumes that {attribute}_id is the foreign key for ActiveRecord associations, which can lead to errors in other parts of your application that may be difficult to diagnose.
let!(:dog) {
create(
name: "Azor",
tag: "Azor 000 000 000",
tag_id: "#12",
)
}
Dog.last.tag # nil
Dog.last.tag_id # nil
Since this is a common naming convention, it's better to avoid names like this and use more straightforward alternatives. For example tag_number.
More information here