As discussed in When Should You Flatten Attributes?, flattening is a technique you should use only under certain conditions. Instead of flattening an attribute or a relationship, you can instead directly traverse the object graph, either programmatically or by using key paths. This ensures that your application maintains an internally consistent view of its data.
There is one scenario in which you might want to use a flattened relationship: If youre modeling a many-to-many relationship and you want to perform a multitable hop to access a table that lies on the other side of an intermediate table.
For example, in the Real Estate database, the Suggestion table acts as an intermediate table between Customer and Listing. Its highly unlikely that you would ever need to fetch instances of Suggestion into your application. In this situation, it makes sense to specify a relationship between Customer and Suggestion and flatten that relationship to give Customer access to the Listing table.