I would extract the nested/non-nested behavior into methods to tidy things up a little. Maybe something like:

```ruby
if nested_errors?
  format_nested_errors(value)
else
  format_error(value)
end

private

def format_nested_errors(value)
  value.map { |obj| obj.errors.messages.join(', ') }
end

def format_error(value)
  if value.nil?
    "nil"
  elsif value.is_a?(String) && value.empty?
    %Q{''}
  else
    value
  end
end
```