Adapt to ActiveRecord >= 3.2 interface.