Fix deprecation warning for ActiveRecord 4.0