Modernize DelayedJob ActiveRecord queries

Fixes behaviour in Rails 4.1.  WDYT?