Locks and preventing agaisnt race-conditions with the db

Does active record or rails have a way to create a lock so that no two
proceses in an application modify the same variable or field in a db at
the same time in order to prevent against race-conditions? Thanks, I’m
new to rails.