More bad ActiveRecord use fixes