I don't think you need to check for empty, and also you are loading data from SQL for no reason, perhaps...
```ruby
self.court_types.where('LOWER(name) not in (?)',['family proceedings court','county court','tribunal'])
```