Raise ActiveRecord::StatementInvalid for Rails 3.1 and below