No, you can’t, but you can pass the :allow_nil => true option to return nil if the master is nil.
class User < ActiveRecord::Base
delegate :company, :to => :master, :allow_nil => true
# ...
end
user.master = nil
user.company
# => nil
user.master = <#User ...>
user.company
# => ...
Otherwise, you need to write your own custom method instead using the delegate macro for more complex options.
class User < ActiveRecord::Base
# ...
def company
master.company if has_master?
end
end