find_or_initialize_by
method is a convenient way to find a record in a database based on certain conditions and, if not found, initialize a new instance of the model with those conditions set.# Example usage @user = User.find_or_initialize_by(email: 'example@example.com')