Update deprecated ActiveRecord calls