Use modern ActiveRecord query syntax to silence deprecations