Using a method in your User model in place of accessing the
relationship's attributes is probably the best way to handle this.
class User < ActiveRecord::Base
department.nil? ? '' : department.name
Whenever you need the department name use that method
user.department_name. Extending this a bit, you could open it up for
all fields (renamed to prevent a conflict with the real attr_accessor
department.nil? ? '' : department.send(field)
Then you can do user.department_attribute(:name).
Or, you could turn off whiny nils (see
config/environments/development.rb), at the expense of obscuring bugs.