What is the best way to ensure a model exists before doing string interpolation. I have a variable user and I need to see what the users major is. The issue is there is a table in between named user_attributes which is where the users info is.
You could avoid
try and add a method to your model or decorator..
def major_name user_attribute.major && user_attribute.major.name end