```ruby
  data = Staff.joins(:person)
              .where("people.name ILIKE :q or
```