Added support for ActiveRecord 4