support ActiveRecord 4+