Adapt to activerecord-4.1.2