That's a pretty long Arel chain to have in a condition.  Maybe move it to a class method?