Use ActiveRecord import gem to speed up importing records