The body of this method could be refactored into this:
```ruby
{text: ontology.ontology_type.name, href: ''} if ontology.ontology_type
```
This would look a lot more concise, as it focuses on the content and not the conditional expression.
Also you do not need to explicitly return `nil`. If an **if**-based expression contains no body (either only the then block or the else block) it will return `nil`.